Skip to main content
Glama

Run a read-only SQL query

execute_sql
Read-onlyIdempotent

Run one read-only PostgreSQL SELECT over the account's TrendsAGI data (tables from read_data_schema: trends, trend_snapshots, trend_categories, trend_insights, watchlist, recommendations, crisis_events). Use for questions that need filtering, joins or aggregation. Returns columns and rows; results stop at max_rows.

Input Schema

NameRequiredDescriptionDefault
queryYesOne SELECT (WITH ... SELECT is fine), e.g. SELECT name, volume, growth_pct FROM trends WHERE last_seen_at > now() - interval '24 hours' ORDER BY velocity_per_hour DESC NULLS LAST LIMIT 20.
max_rowsNoMost rows to return (1-200).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, idempotentHint, destructiveHint and openWorldHint, so the safety profile is handled. The description adds genuinely new behavioral context: single SELECT only, returns columns and rows, and results are truncated at max_rows — a non-obvious silent-cap behavior an agent must plan around.

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, front-loaded with the operation and scope, then usage guidance, then return/limit behavior. The table list is dense but earns its place by telling the agent what it can query without a discovery call.

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

Completeness5/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 still describes the return shape (columns and rows) and the truncation limit, and it names the queryable tables plus the schema-discovery sibling. Nothing essential for correct invocation is missing.

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 both parameters are already documented in the schema, including an example SELECT and the 1-200 range. The description only echoes the max_rows truncation, so baseline 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?

States a specific verb and resource ('Run one read-only PostgreSQL SELECT over the account's TrendsAGI data') and enumerates the exact tables covered, which clearly separates it from the narrow siblings like get_trend, list_trends and search_trend_insights.

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?

Gives an explicit selection condition — 'Use for questions that need filtering, joins or aggregation' — which implicitly routes simple single-entity lookups to the get_*/list_* siblings, and points at read_data_schema for discovery. It stops short of naming the alternatives or stating exclusions, so it is clear but not exhaustive.

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.