Skip to main content
Glama
HemanthSaiPrasad

sql-copilot

run_query

Execute a single read-only PostgreSQL SELECT query returning up to 100 rows, with writes and risky functions rejected for safety. Read error messages to fix and retry failed SQL.

Instructions

Run ONE read-only PostgreSQL SELECT query. Returns up to 100 rows.

Writes, multiple statements and risky functions are rejected with a reason. If a query fails, read the error message, fix the SQL, and try again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

The description discloses key behaviors: read-only enforcement, rejection of writes and multiple statements, return limit of 100 rows, and error handling advice. Although annotations are not provided, the description covers significant behavioral traits beyond the schema, but it doesn't detail failure modes or side effects (e.g., no mention of rate limits or resource usage). With no annotations, this is adequate but not exhaustive.

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?

The description is compact and efficient, using bullets to front-load the most critical constraints (one query, read-only, row limit) and then providing helpful error-handling guidance. Every sentence adds value without fluff.

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?

Given the tool's simplicity (one parameter) and that an output schema exists, the description covers the essentials: what kind of query to provide, constraints, and error handling. It doesn't describe the output structure, but the output schema likely covers that. It is complete enough for an agent to call it correctly, though it could mention pagination for more than 100 rows.

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?

With only one 'sql' parameter and 0% schema coverage, the description must compensate. It explicitly states the parameter should be a single PostgreSQL SELECT query, and clarifies that it's read-only and rejects multiple statements or risky functions, adding semantic meaning beyond the bare schema field name.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Run ONE read-only PostgreSQL SELECT query' with a specific verb and resource. It distinguishes from siblings by implying it executes queries, while siblings like list_tables and describe_table are for metadata inspection, though it doesn't explicitly name them.

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

Usage Guidelines4/5

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

The description provides clear context: it is for one read-only SELECT query, and mentions that writes are rejected. It doesn't explicitly state when to use this vs. siblings (e.g., for data retrieval vs. metadata), but the read-only nature and rejection of multiple statements imply appropriate usage.

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

Deploy Server

Other Tools