Skip to main content
Glama
igorolv

jdbc-mcp-server

timedQuery

timedQuery
Read-onlyIdempotent

Run a read-only SQL query and return its rows plus elapsed time, with optional parameter binding and per-statement performance counters.

Instructions

Measure one read-only SQL SELECT / WITH / EXPLAIN while still returning its rows and elapsed time. Use executeQuery when timing is irrelevant or benchmarkQuery for repeated cold/warm measurements. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name. Adds available per-statement counter deltas (calls, execution time, rows, buffer hits/reads).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNoRow limit (default JDBC_MAX_ROWS).
paramsNoValues for '?' placeholders, in order.
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.
namedParamsNoValues for ':name' placeholders, keyed by name.
timeoutSecondsNoTimeout in seconds (default JDBC_QUERY_TIMEOUT_SECONDS).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsNoReturned result rows as column-name to value maps, capped by the requested limit.
engineNoDatabase engine that produced the result, such as PostgreSQL, Oracle, or SQL Server.
columnsNoResult column names in output order.
rowCountYes
elapsedMsYesWall-clock elapsed time for the query execution, in milliseconds.
truncatedYesTrue when the configured row or finding cap was reached and more data may exist.
columnTypesNoDatabase type names for the result columns, in the same order as columns.
pgStatStatementsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already provide readOnlyHint, idempotentHint, and non-destructive hints. The description adds meaningful behavior beyond that: it returns both rows and elapsed time, reports per-statement counter deltas, and warns against mixing '?' and ':name' placeholder styles. This gives the agent useful operational expectations without contradicting the 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?

The description is front-loaded with the core purpose, immediately names alternatives, and then gives binding guidance with a concrete example. Every sentence adds distinct information and there is no filler or repetition of schema fields.

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?

The description covers the tool's purpose, when to use alternatives, parameter binding conventions, and supplementary return information. Given the output schema exists and annotations cover safety, the description is complete enough for an agent to select and invoke the tool correctly.

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 description coverage is 83%, so the schema already documents most parameters. The description adds valuable semantics by explaining the mapping of '?' to params and ':name' to namedParams, giving an explicit example, and stating that keys should be the bare name. This resolves ambiguity that the raw schema does not fully cover.

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 names a precise action and resource: measuring a single read-only SQL SELECT/WITH/EXPLAIN while returning rows and elapsed time. It also differentiates itself from executeQuery and benchmarkQuery by referencing them explicitly, so an agent can distinguish this tool from its closest siblings.

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?

It gives explicit routing guidance: use executeQuery when timing is irrelevant and benchmarkQuery for repeated cold/warm measurements. It also clarifies the one-shot nature of this tool ('Measure one') and provides binding rules, making the intended usage context very clear.

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