Skip to main content
Glama
QueryPilot MCP

QueryPilot MCP

run_query

Read-onlyIdempotent

Executes one read-only DuckDB SELECT query on tables listed by list_tables, returning up to max_rows with truncation status; queries stop after 30 seconds.

Instructions

Run ONE read-only SELECT (DuckDB SQL) on the tables from list_tables. Returns at most max_rows rows (hard cap 1000); 'truncated' is true if more rows existed. Queries are stopped after 30 seconds.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "run_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
max_rowsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses key operational behavior: at most max_rows rows are returned, there is a hard cap of 1000, a truncated flag indicates whether more rows existed, and execution stops after 30 seconds. These are concrete limits an agent needs before invoking the tool.

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 definition is three compact sentences, front-loaded with the action and followed by return and timeout constraints. Every sentence adds operational information without redundancy.

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 read-only query tool with annotations and an output schema, the description covers the essential calling context: allowed statement type, table source, row cap, truncation signal, and timeout. Remaining gaps around error behavior and the max_rows default are minor.

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?

The schema has no parameter descriptions, so the description carries the burden and meaningfully explains both parameters: sql must be one read-only DuckDB SELECT over listed tables, and max_rows controls the row limit subject to a hard cap of 1000. It could still clarify the default and edge cases, but it compensates well for the low schema coverage.

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 states a specific verb and resource: run one read-only SELECT using DuckDB SQL on tables from list_tables. This clearly distinguishes it from metadata and sampling siblings by making query execution the core action.

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 gives clear context: queries are run against tables discovered via list_tables, and only a single read-only SELECT is allowed. It does not explicitly compare against sibling tools such as sample_rows, so alternatives are left implicit.

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