Skip to main content
Glama
igorolv

jdbc-mcp-server

executeQuery

executeQuery
Read-onlyIdempotent

Execute read-only SQL queries (SELECT, WITH, EXPLAIN) on PostgreSQL, Oracle, or SQL Server to fetch actual result rows. Supports positional or named parameters, with optional row limits and timeouts.

Instructions

Run a read-only SQL SELECT / WITH / EXPLAIN when actual result rows are needed. Use timedQuery for one timed execution or benchmarkQuery for repeated latency measurements. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name. Sets 'truncated' when the row cap is hit.

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
rowsNoRows.
columnsNoColumns.
rowCountYesRow Count.
truncatedYesTruncated.
columnTypesNoColumn Types.

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 cover read-only and non-destructive behavior, and the description adds meaningful behavioral context: 'Sets truncated when the row cap is hit.' The binding rule 'never mix' also discloses a constraint not present in the annotations. No contradiction.

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?

Three dense sentences cover purpose, alternatives, binding semantics, example, and truncation behavior. The most important usage guidance is front-loaded, and every sentence earns its place.

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 is complete for an agent invoking the tool: it states the query types allowed, the sibling tools for timing, parameter binding rules, and the truncation signal. The output schema and annotations cover return values and safety, so nothing essential 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%, but the description adds real value by explaining the relationship between '?' placeholders and params, ':name' placeholders and namedParams, and gives a concrete example with the bare-name rule. This goes beyond the schema's short descriptions.

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 a read-only SQL SELECT / WITH / EXPLAIN when actual result rows are needed.' It also distinguishes the tool from timedQuery and benchmarkQuery, making it clear this is the general row-returning query tool.

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 explicitly says 'Use timedQuery for one timed execution or benchmarkQuery for repeated latency measurements,' giving an agent concrete alternative-selection criteria. The phrase 'when actual result rows are needed' further clarifies the intended use case.

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