Skip to content

return json strings from query results instead of dicts#154

Open
knQzx wants to merge 1 commit intoClickHouse:mainfrom
knQzx:fix/return-json-string-from-queries
Open

return json strings from query results instead of dicts#154
knQzx wants to merge 1 commit intoClickHouse:mainfrom
knQzx:fix/return-json-string-from-queries

Conversation

@knQzx
Copy link
Copy Markdown

@knQzx knQzx commented Mar 26, 2026

execute_query returns a dict but mcp protocol expects strings, so every successful query triggers a validation error. wrapped the return values with json.dumps. also added default=str which handles large UInt64 values that would otherwise lose precision

fixes #141, helps with #111

mcp protocol requires tool results to be strings but execute_query
and run_query were returning raw dicts, causing validation errors
on every successful response. also fixes large UInt64 values getting
corrupted since json.dumps with default=str serializes them properly

fixes ClickHouse#141, helps with ClickHouse#111
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 26, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run_query and list_tables return dicts instead of JSON strings, causing MCP output validation errors

2 participants