Skip to main content
Glama

execute_analytics_sql

Run read-only analytical SQL queries against DuckDB and validate statements to reject non-SELECT or DDL/DML commands, ensuring safe, analysis-only data retrieval.

Instructions

Execute a read-only analytical SQL query directly against DuckDB.

Rejects any non-SELECT/WITH statements or DDL/DML commands via SQLGlot AST validation.

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": {
      "sql": "<sql>"
    },
    "name": "execute_analytics_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose meaningful behavior: the tool is read-only, it rejects non-SELECT/WITH statements and all DDL/DML, and enforcement is done through SQLGlot AST validation rather than a naive prefix check. It does not mention execution limits, timeouts, dialect caveats, or what an agent sees on rejection, which keeps it below 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 short sentences, zero filler, with the read-only constraint front-loaded and the enforcement mechanism as supporting detail. Nothing is repeated from the schema.

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?

An output schema exists, so return values need no explanation, and the safety-critical constraint is covered. What remains unstated is the practical context an agent needs to succeed — which tables exist, whether errors surface as text or exceptions, and any row or runtime caps.

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 0% — the single parameter is just a bare string named 'sql'. The description compensates by establishing that the string is a DuckDB-dialect analytical query and must be a SELECT or WITH statement, which materially constrains what the agent may pass.

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?

States a specific verb and resource — executing a read-only analytical SQL query directly against DuckDB — which is concrete and distinguishable from a pure SQL-generation sibling. It stops short of explicitly naming an alternative, so an agent must infer that generate_sql_only produces text rather than running it.

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: call this when you already have a SELECT/WITH statement you want run. There is no explicit guidance on when to prefer it over ask_business_question or generate_sql_only, and no stated prerequisites such as needing to inspect_ontology first to know table names.

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