Skip to main content
Glama

Read-only query

schema_query

Runs one read-only SELECT or WITH statement with a row limit for schema inspection; the database user must remain read-only because the guard is not a permission boundary.

Instructions

Run one read-only SELECT/WITH statement with a row limit. The DB user must still be read-only; the guard is not a permission boundary.

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

Input Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses single-statement scope, a server-side row limit, and the critical caveat that the guard 'is not a permission boundary' so the DB user must itself be read-only. It omits the actual row-limit value and error/empty-result behavior, keeping it out of 5 territory.

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?

Two sentences, zero waste. The operation and its scope lead, and the security caveat follows where it is most needed. Nothing is repeated from the schema.

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 one-parameter tool with no output schema and no annotations, the essentials are covered: valid statement shape, single-statement limit, row capping, and the permission caveat that prevents an agent from treating the guard as a sandbox. Only the concrete row-limit number and failure semantics are missing.

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 coverage is 0% – the single 'sql' param is documented only as a non-empty string – so the description must compensate, and it does: it constrains the payload to exactly one SELECT or WITH statement. It leaves minor gaps such as trailing-semicolon handling or whether literal-only queries are permitted.

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?

States a specific verb ('Run') and a precisely bounded resource: 'one read-only SELECT/WITH statement with a row limit.' The 'one' and 'SELECT/WITH' qualifiers make it immediately distinguishable from the metadata siblings (schema_tables, schema_columns) without opening any schema.

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 implied rather than stated: an agent can infer this is the tool for ad-hoc read queries while the schema_* siblings fetch metadata. However, no alternative is named and no explicit when-not condition is given (e.g., 'do not use for DDL' is only implied by 'SELECT/WITH').

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