query_sql
Execute read-only SQL queries against PostgreSQL, MySQL, or SQL Server. Automatically adapts syntax to the target dialect. Returns results with connection and dialect metadata. Default limit 100 rows.
Instructions
Execute a read-only SQL query against the target connection. ONLY SELECT / WITH / EXPLAIN permitted. Write dialect-appropriate SQL for the connection's engine — PostgreSQL syntax for postgres, T-SQL for mssql, MySQL for mysql. Response meta includes connection + dialect so you know which syntax worked. Default LIMIT 100 unless the user asks for all rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- bin/server.js:33-39 (registration)Registration of the query_sql tool in the TOOLS array. It is defined with name, description, and inputSchema, but no actual handler — this is a static catalog adapter that redirects execution to the hosted endpoint.
// DISCOVER tier (free) { name: "query_sql", description: "Execute a read-only SQL query against the target connection. ONLY SELECT / WITH / EXPLAIN permitted. Write dialect-appropriate SQL for the connection's engine — PostgreSQL syntax for postgres, T-SQL for mssql, MySQL for mysql. Response meta includes `connection` + `dialect` so you know which syntax worked. Default LIMIT 100 unless the user asks for all rows.", inputSchema: { type: "object" }, }, - bin/server.js:190-193 (handler)Handler for all tool call requests, including query_sql. This is a generic redirect handler — it does not execute query_sql logic but instead returns a message telling the user to use the hosted endpoint at https://data.thinair.co/mcp.
server.setRequestHandler(CallToolRequestSchema, async () => ({ content: [{ type: "text", text: REDIRECT_MESSAGE }], isError: false, }));