Skip to main content
Glama

apex_run_sql

Read-onlyIdempotent

Execute any SQL statement (SELECT, DML, DDL) against Oracle APEX. Returns query results as JSON rows or affected row count for writes.

Instructions

Execute any SQL statement (SELECT/DML/DDL). Returns rows or affected count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL SELECT statement or PL/SQL anonymous block (BEGIN...END). For SELECT: returns rows as JSON array. For PL/SQL: executes and returns 'OK' or error message.
max_rowsNoMaximum rows to return for SELECT (default 100, max 1000).
bind_paramsNoOptional dict of bind variables (e.g., {"id": 42, "name": "John"}). Use :variable_name in SQL and pass values here to prevent SQL injection. Example: apex_run_sql("SELECT * FROM my_table WHERE id = :id", bind_params={"id": 42})

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior1/5

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

The description explicitly supports DML/DDL statements, which can modify data and schema, yet the annotations declare readOnlyHint=true and destructiveHint=false. This is a direct contradiction. The description also provides no warnings about potential side effects, commits, or irreversibility. This is a serious transparency failure.

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?

The description is a single, focused sentence that captures the core function (execute SQL) and the key output types (rows or affected count). There is no redundancy or filler, and the information is front-loaded.

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

Completeness2/5

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

The description omits critical context for a tool that can execute DML/DDL: no mention of transaction handling, the ability to undo changes, or the need for permissions. Given the tool's power and the contradictory annotations, the description is incomplete even though the schema provides parameter details.

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?

The input schema has 100% coverage, with detailed descriptions and examples for sql, max_rows, and bind_params. The description adds no additional parameter semantics beyond the schema, but since the schema fully explains each parameter, the baseline score 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 clearly states the tool executes any SQL statement (SELECT/DML/DDL) and returns rows or affected count. This is a specific verb-action (execute) on a clear resource (SQL) and distinguishes the tool from sibling APEX tools that focus on app building rather than raw SQL execution.

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 usage guidance is given. The description does not indicate when to use this tool versus alternative, safer options like apex_describe_table or apex_generate_crud. There are no exclusions or prerequisites mentioned, leaving the agent without clear direction on when raw SQL execution is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TechFernandesLTDA/apex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server