Skip to main content
Glama
oracle-mcp-server

oracle-mcp-server

by Tommi2Day

top_sql

Retrieve top SQL statements from Oracle's shared pool ranked by elapsed time, CPU, buffer gets, disk reads, or executions, with per-execution averages and SQL IDs for performance tuning.

Instructions

Top SQL statements from the shared pool (V$SQLAREA) by elapsed time, CPU, buffer gets, disk reads or executions, with per-execution averages and sql_id.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "top_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of rows (default 10)
schemaNoOnly statements parsed by this schema
order_byNoSort metric (default elapsed)
sql_text_likeNoCase-insensitive substring filter on the SQL text
include_systemNoInclude statements parsed as SYS (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. Naming V$SQLAREA implies a read-only query against a shared-pool view, and the mention of per-execution averages and sql_id hints at the returned content, but it never states read-only semantics, privilege requirements (e.g. for SYS-parsed statements), or default row behavior beyond the schema's 'default 10'.

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?

A single front-loaded sentence that names the source, the ranking dimensions, and the returned extras, with no filler or redundant phrasing.

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 read-only diagnostic query with no annotations and no output schema, the description covers purpose and source but is thin on return shape (it names only sql_id and per-execution averages) and on privilege/behavior details. Adequate but with clear gaps for an agent assembling a diagnostic workflow.

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 coverage is 100%, so every parameter is already documented, establishing a baseline of 3. The description's metric list mirrors the order_by enum and adds no syntax or format detail (e.g. elapsed_per_exec) beyond what the schema states.

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 gives a specific resource ('Top SQL statements from the shared pool (V$SQLAREA)') and enumerates the sortable metrics, so the agent knows exactly what the tool returns. It distinguishes itself from generic siblings like query or sql_plan by naming the dynamic performance view and the ranking semantics, though it does not explicitly name a sibling it replaces.

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

Usage Guidelines3/5

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

Usage is implied by the metric list (top-N performance diagnostics), but there is no explicit when-to-use, when-not-to-use, or pointer to sql_plan for a single statement's plan. The agent must infer the diagnostic context from the description alone.

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