Skip to main content
Glama
kosminus

querywise-mcp

run_sql

Read-only

Execute read-only SQL SELECT queries against a database connection, returning rows, columns, row count, and execution time while rejecting unsafe statements.

Instructions

Execute a read-only SQL SELECT against the target database and return the rows.

Use to run SQL you wrote from get_semantic_context. Enforces read-only: rejects INSERT/UPDATE/DELETE/DDL and other unsafe statements; results are row-limited per the connection's max_rows. Returns columns, rows, row_count, truncated, and execution_time_ms. To have the server write the SQL for you, use generate_sql or ask.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionYesTarget database connection — its name or id (case-insensitive). List the available connections with list_connections.
sqlYesA single read-only SELECT statement to execute. Non-SELECT or unsafe SQL is rejected.
Behavior5/5

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

Beyond annotations (readOnlyHint: true), the description adds that it rejects unsafe statements, is row-limited, and returns specific fields (columns, rows, row_count, truncated, execution_time_ms). No contradiction with annotations.

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?

Three sentences, front-loaded with purpose, each sentence provides essential information without redundancy. No wasted words.

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

Completeness5/5

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

Despite no output schema, the description lists return fields. It covers purpose, usage, safety, and return format, making it complete for this straightforward tool.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description does not add new meaning beyond schema descriptions for the two parameters; it only reiterates the constraints already present in the schema.

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 'Execute a read-only SQL SELECT against the target database and return the rows,' specifying a specific verb, resource, and scope. It distinguishes itself from siblings like generate_sql which writes 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?

Explicitly says 'Use to run SQL you wrote from get_semantic_context' and recommends generate_sql or ask for server-written SQL, providing clear when-to-use and alternatives.

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