Skip to main content
Glama
igorolv

jdbc-mcp-server

getQuery

getQuery
Read-onlyIdempotent

Retrieve the full stored record for a known query: SQL, parameters, parsed tables/columns/joins, outputs, and field usages. Use after discovery tools for complete details.

Instructions

Retrieve the complete stored record for one query whose source identity is already known. Returns SQL, parameters, parsed tables/columns/joins, outputs and field usages; use listQueries, findQueriesByTable or findQueriesByColumn to discover matching records first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.
sourceKindYesSource kind, e.g. dao, report, database-view.
sourcePathYesStable source path, e.g. file path.
sourceUnitNoOptional sub-unit, e.g. method name.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoBusiness tags attached to the usage-catalog query.
rawSqlNoOriginal SQL text stored in the usage catalog.
tablesNoTables included in this context, graph, query inspection, or usage record.
columnsNoResolved column references extracted from the known query.
outputsNoDocumented output fields produced by the query.
joinPairsNoJoin pairs extracted from the query and stored in the usage catalog.
parametersNoDocumented parameters for this known query.
sourceKindNoKind of source that produced the catalog query, such as file, view, routine, or configured import.
sourcePathNoPath or database object name where the catalog query came from.
sourceUnitNoStable unit identifier inside the source, such as query id, method name, view name, or routine name.
fieldUsagesNoSemantic field usages attached to the query outputs or expressions.
parseStatusNoSQL parse status for a catalog query, such as parsed or failed.
businessLabelNo
normalizedSqlNoNormalized SQL text produced by parser or usage-catalog indexing.
businessDomainNoBusiness domain assigned to the catalog query or usage record.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds value by specifying exactly what the returned record contains (SQL, parameters, parsed components, outputs, field usages), which is behavioral detail beyond the annotations. It does not contradict annotations and does not discuss edge cases like pagination, but that is minor for a read-only retrieval tool.

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 with zero waste: the first states purpose and return content, the second gives routing to sibling tools. The most important info is front-loaded, and every clause 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?

For a read-only retrieval tool with a full output schema and complete parameter documentation, the description is complete. It covers purpose, what is returned, and how to discover the required identity. The existence of an output schema means return-value details need not be repeated, and annotations cover safety. Nothing an agent needs to call it correctly is missing.

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%, with each parameter (connection, sourceKind, sourcePath, sourceUnit) having a description. The description adds the concept of 'source identity' and that these parameters identify the query, but it does not add syntax or format details beyond what the schema already provides. Since the schema carries the heavy lifting, the baseline of 3 is appropriate.

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 ('Retrieve') with a clear resource ('the complete stored record for one query') and explicitly enumerates the returned content (SQL, parameters, parsed tables/columns/joins, outputs, field usages). It also names sibling tools (listQueries, findQueriesByTable, findQueriesByColumn) as the discovery path, distinguishing this retrieval tool from search tools.

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?

The description explicitly tells the agent when to use this tool: when the source identity is already known, and instructs to use listQueries, findQueriesByTable, or findQueriesByColumn to discover matching records first. This provides clear context and exclusions, leaving no ambiguity about when to select this tool over its siblings.

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