Skip to main content
Glama
kosminus

querywise-mcp

generate_sql

Read-only

Translate a natural-language question into an SQL statement using an LLM. Review the generated SQL before executing it with run_sql.

Instructions

Translate a natural-language question into SQL via the server LLM, without executing it.

Requires an LLM provider to be configured. Use when you want to review or edit the SQL before running it with run_sql. For zero-key operation, use get_semantic_context and write the SQL yourself; to also execute and interpret in one step, use ask. Returns the generated SQL plus supporting details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionYesTarget database connection — its name or id (case-insensitive). List the available connections with list_connections.
questionYesNatural-language question to translate into SQL.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint and openWorldHint, and description aligns by stating it does not execute. Adds that it requires an LLM provider and returns generated SQL plus supporting details. Slight gap: no mention of rate limits or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, each delivering distinct information: main action, prerequisite, usage alternatives, return. Highly efficient with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a generate-only tool with no output schema, description adequately specifies return type (SQL plus details). Could mention output format or potential errors, but overall sufficient for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters with clear descriptions (100% coverage). Description adds value by suggesting list_connections for connection parameter, and clarifies question is natural-language. No redundancy.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it translates natural-language to SQL without executing, using the server LLM. It explicitly distinguishes from siblings like ask (one-step execute and interpret) and run_sql (executes SQL).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use (review/edit SQL before run_sql) and when-not (zero-key use get_semantic_context, or use ask for single-step). Includes prerequisite (LLM provider configured) and directs to list_connections for available connections.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kosminus/querywise-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server