Skip to content

fix(mcp): add query→sql backward compat alias in query_asset_tool#216

Open
mothership-ai[bot] wants to merge 1 commit intomainfrom
fix/aichat-833-query-sql-alias
Open

fix(mcp): add query→sql backward compat alias in query_asset_tool#216
mothership-ai[bot] wants to merge 1 commit intomainfrom
fix/aichat-833-query-sql-alias

Conversation

@mothership-ai
Copy link
Copy Markdown

@mothership-ai mothership-ai Bot commented Apr 2, 2026

Session owner: @

Summary

  • Adds query as a deprecated alias parameter to query_asset_tool for backward compatibility
  • LLM clients still send query (the old param name) instead of sql, causing ~8 errors/30d (Unexpected keyword argument: query)
  • If query is provided but sql is not, query is used as sql transparently

Changes

  • modelcontextprotocol/server.py: Added optional query param to query_asset_tool, with alias logic at function entry point and explicit validation when neither param is provided

Test plan

  • Call query_asset_tool(query="SELECT 1", connection_qualified_name="...") → should work (backward compat)
  • Call query_asset_tool(sql="SELECT 1", connection_qualified_name="...") → should work (current behavior)
  • Call query_asset_tool(connection_qualified_name="...") with neither sql nor query → should return error
  • Call with both sql and querysql takes precedence

Closes AICHAT-833

🤖 Generated with Claude Code

LLM clients still send `query` (old param name) instead of `sql`,
causing ~8 errors/30d. Accept `query` as a deprecated alias.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mothership-ai mothership-ai Bot requested review from Hk669 and firecast as code owners April 2, 2026 03:55
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.

1 participant