Skip to main content
Glama
igorolv

jdbc-mcp-server

timedQuery

timedQuery
Read-onlyIdempotent

Measure one read-only SELECT, WITH, or EXPLAIN query while returning its rows and elapsed time for query performance analysis.

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: the connection's maxRows).
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: the connection's queryTimeoutSeconds).

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, SQL Server, Firebird, or SQLite.
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. Changed3 schema fields changedv0.2.0
    • changedInput schema / properties / limit / description
      Previous value: -"Row limit (default JDBC_MAX_ROWS)."New value: +"Row limit (default: the connection's maxRows)."
    • changedInput schema / properties / timeoutSeconds / description
      Previous value: -"Timeout in seconds (default JDBC_QUERY_TIMEOUT_SECONDS)."New value: +"Timeout in seconds (default: the connection's queryTimeoutSeconds)."
    • changedOutput schema / properties / engine / description
      Previous value: -"Database engine that produced the result, such as PostgreSQL, Oracle, or SQL Server."New value: +"Database engine that produced the result, such as PostgreSQL, Oracle, SQL Server, Firebird, or SQLite."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds real behavioral context the annotations do not: it returns rows plus elapsed time and appends per-statement counter deltas (calls, execution time, rows, buffer hits/reads). It does not discuss error or partial-failure behavior, which keeps it short of a 5.

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?

Front-loaded with the core purpose, then alternatives, then binding rules and return additions. Every sentence carries information, though the placeholder-binding example makes it dense enough that it is more packed than elegant.

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?

Output schema exists, so return values need not be re-explained, yet the description still flags the timing and counter-delta outputs that an agent would care about. Combined with the alternative routing and binding rules, nothing needed to invoke this correctly is 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 83%, so baseline is 3, but the description adds binding semantics the schema does not: '?' maps to params, ':name' maps to namedParams, they must never be mixed, and the namedParams key is the bare name (illustrated with :status -> {status:'PAID'}). That is genuinely additive despite limit/timeout/connection being documented only in the schema.

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 and resource (measure a read-only SELECT/WITH/EXPLAIN) plus the unusual dual behavior of returning rows AND elapsed timing, which is exactly what differentiates it from executeQuery and benchmarkQuery. An agent can select it without opening the schema.

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?

Explicitly routes to alternatives with the selecting condition: 'Use executeQuery when timing is irrelevant or benchmarkQuery for repeated cold/warm measurements.' Both when-to-use-this and when-to-use-something-else are present.

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