Skip to main content
Glama

Execute Read-Only SQL

execute_sql
Read-onlyIdempotent

Execute a read-only SQL SELECT query against the Compabase database. Use when dedicated tools are not enough (aggregations, joins, custom analysis). Returns at most row_limit rows per call depending on the plan (Free 100, Pro 500, Scale 1000); if truncated is true, the full result is larger and fits better as an aggregate inside SQL (GROUP BY, COUNT, AVG, percentile_cont).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "execute_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesA read-only SQL SELECT or WITH…SELECT statement.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered; the description goes further by disclosing per-plan row caps (100/500/1000) and the truncation signal with remediation advice (re-express as GROUP BY/COUNT/AVG/percentile_cont). It does not mention query timeouts, cost, or what happens on a rejected non-SELECT, which keeps it from a 5.

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 dense but purposeful sentences: capability and routing first, then result-size behavior and the corrective pattern. No filler, no repetition of the title, and the most decision-relevant constraint is front-loaded.

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?

There is no output schema, and the description compensates by explaining the result shape (row cap per plan, 'truncated' flag). For a single-parameter, annotate-covered tool this is nearly complete; only error/failure behavior and the SQL dialect are left implicit.

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% for the single 'query' parameter and the schema already states it must be a read-only SELECT or WITH…SELECT. The description reinforces the read-only constraint but adds no syntax or dialect detail beyond that; with only one fully documented parameter, the schema carries the weight.

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 gives a specific verb and resource ('Execute a read-only SQL SELECT query against the Compabase database') and immediately positions it against the dedicated sibling tools ('use when dedicated tools are not enough'). An agent can tell exactly what class of operation this is and when it is the right pick without opening the schema.

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?

It states the selecting condition clearly (aggregations, joins, custom analysis that dedicated tools cannot serve), which is real routing guidance. It does not name specific sibling tools or state an explicit when-not, so the agent must infer the boundary, but the context is unambiguous enough to act on.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.