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, aggregate inside SQL (GROUP BY, COUNT, AVG, percentile_cont) instead of listing raw rows.

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 non-destructive, so safety is covered. The description adds genuinely new behavior: per-plan row caps (Free 100, Pro 500, Scale 1000) and the existence of a 'truncated' flag with a recommended recovery strategy — operational detail the annotations cannot express. It stops short of disclosing timeouts, cost/rate limits, or which tables/columns are queryable, which are the remaining unknowns for a SQL surface.

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?

Three sentences, each load-bearing: what it does, when to reach for it, and how to handle truncation. The routing constraint is front-loaded in sentence two and the truncation fallback in sentence three, so nothing is buried or repeated.

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?

With no output schema, the description steps in to explain the return shape (at most row_limit rows, plus a 'truncated' boolean), which is the key thing an agent needs. It leaves minor gaps — no mention of query timeout, error behavior on non-SELECT input, or what tables exist — but for a 1-parameter tool this is close to complete.

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?

There is a single parameter with 100% schema coverage, so the schema already carries the documented meaning ('A read-only SQL SELECT or WITH…SELECT statement'). The description adds only indirect value by naming functions it expects to work (GROUP BY, COUNT, AVG, percentile_cont), hinting at a PostgreSQL-like dialect. Useful, but the baseline 3 is right when the schema does the work.

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?

States a specific verb and resource ('Execute a read-only SQL SELECT query against the Compabase database') and immediately positions it against the ~50 dedicated sibling tools by saying it is for cases where those are 'not enough'. An agent can distinguish it from get_company_financials or count_companies without opening either schema.

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

Usage Guidelines5/5

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

Explicitly names the selection condition (dedicated tools insufficient) and the concrete use cases that qualify (aggregations, joins, custom analysis). It also gives a follow-up rule of thumb — when 'truncated is true', switch to in-SQL aggregation rather than pulling raw rows — which is an actionable alternative path, not just context.

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.