Skip to main content
Glama

get_session_sql_text

Retrieve the full SQL text currently executed by an Oracle session using its SID and serial number. Identify running statements for diagnostics or tuning.

Instructions

Return the full SQL text currently being executed by a session, given its sid and serial#.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sidYesSession id (SID).
serialNumYesSession serial number.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden. 'Currently being executed' implicitly hints that idle sessions yield nothing, but it never states what happens for an inactive/unknown session, whether querying another user's session SQL requires elevated privileges, or whether the result is truncated for very long statements.

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 front-loaded sentence with no filler; the verb, resource, and qualifier appear in order. It is efficient, though the terseness leaves behavioral gaps unaddressed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter read with fully covered schema and no output schema, the definition is minimally adequate. It hints at the return value ('full SQL text') but omits behavior for inactive sessions and any privilege requirements, which an agent would need to invoke it confidently.

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%, so the schema already documents sid (SID) and serialNum (session serial number). The description merely names the same two identifiers, adding no format, source, or retrieval guidance beyond 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?

The description states a specific verb (Return) and a precisely scoped resource (the full SQL text currently being executed by a session), which clearly separates it from siblings like list_top_sql or get_wait_events. It does not explicitly name a sibling or contrast scope, so it falls short of the top band.

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

Usage Guidelines2/5

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

No when-to-use guidance, no mention of alternatives (e.g., list_top_sql for aggregate SQL, get_wait_events for waits), and no exclusions. The phrase 'given its sid and serial#' only restates the input requirement rather than explaining when this tool is the right choice.

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