Skip to main content
Glama

run_query

Execute a single SELECT statement to retrieve rows from an Oracle database. Use optional offset and limit for paginated results.

Instructions

Run a single SELECT statement and return the result set. Optional offset/limit enable stateless pagination (non-deterministic without an ORDER BY in the SQL). Non-SELECT statements or privilege failures return an Oracle error string. NOTE: recursive constructs like CONNECT BY and WITH (CTE) may be rejected by the SQL parser; for set differences use MINUS, and for row-number/gap problems prefer computing on the returned result set rather than relying on recursive SQL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SELECT statement.
limitNoMaximum rows to return for this page. Capped at the server max-rows. Defaults to the server max.
offsetNo0-based row offset for pagination. Defaults to 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

A4/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 well: it discloses that offset/limit pagination is non-deterministic without an ORDER BY, that failures surface as Oracle error strings rather than exceptions, and that recursive constructs may be rejected by the parser. It does not describe concurrency, timeouts, or privilege requirements beyond the failure hint.

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?

A single paragraph with the core purpose front-loaded, followed by pagination caveats and workarounds. Every sentence is substantive, though the recursive-construct workaround sentence is dense and could be trimmed.

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 read-only query tool with no annotations, no output schema, and full parameter coverage, the description covers return behavior, error behavior, and pagination limits adequately. Remaining gaps (timeouts, row-size limits) are minor.

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 100%, so the baseline is 3, but the description adds real meaning on top of the schema by explaining that offset/limit enable stateless pagination and that ordering must come from the SQL itself for determinism. That non-determinism caveat is not captured in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Run a single SELECT statement and return the result set.' The 'SELECT' restriction cleanly separates it from the many metadata list_* siblings and from the execute_dml* tools, though it never names an alternative explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Offers substantive when-it-fails guidance (non-SELECT statements and privilege failures return an Oracle error string) and steers around parser limits by recommending MINUS for set differences and client-side computation for row-number/gap problems. It lacks explicit routing to sibling tools (e.g. count_rows, get_sample_data), so it stops short of a 5.

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