Skip to main content
Glama
local-context
by JustinA988

query_sql

Read-only

Execute one SQLite statement against a database or ad-hoc file to retrieve rows, with ad-hoc files kept read-only and results capped.

Instructions

Run one SQLite statement. Ad-hoc files are read-only. Rows are capped.

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": "query_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SQL statement.
limitNoMax rows.
databaseNoSQLite source name or path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered structurally. The description adds two real behavioral facts: only one statement is executed and row output is capped. However, it never states the cap value, and 'Ad-hoc files are read-only' ambiguously implies other sources might permit writes, which sits uneasily with readOnlyHint=true and is left unexplained.

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

Conciseness4/5

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

Three short fragments, front-loaded with the core action, with no filler or restatement of the title. It is efficiently sized for a tool whose schema carries most of the detail. It is telegraphic to the point that the clipped phrasing ('Rows are capped.') withholds a number an agent would want.

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

Completeness3/5

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

The tool is simple (3 params, full schema coverage, no output schema to explain, annotations covering safety), so the bar is moderate. Still missing are the actual row cap value and how it relates to the 'limit' parameter, plus what happens if multiple statements are supplied. Adequate to invoke, but leaves the caller to discover the limits empirically.

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 description coverage is 100%, so all three parameters (sql, limit, database) are already documented inline, making 3 the baseline. The description adds no meaning beyond the schema — it does not clarify how 'limit' interacts with the stated row cap, or what constitutes a valid 'database' value versus a path. It neither compensates for nor undermines the schema.

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?

States a specific verb and resource ('Run one SQLite statement'), which clearly distinguishes it from siblings like read_file, search_text, or list_sources that operate on files rather than SQL. The single-statement constraint is a meaningful scoping detail. It does not explicitly name a sibling alternative, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the tool for SQL querying SQLite sources, but nothing states when to prefer it over read_source or list_sources, nor when-not to use it. The clause 'Ad-hoc files are read-only' hints at an eligibility boundary without explaining it. No explicit routing guidance is given.

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