Skip to main content
Glama
Grist MCP Server
by nic01asFr

Execute Sql Query

execute_sql_query

Run read-only custom SQL queries on Grist documents to retrieve joined, aggregated, or filtered data for analysis and reporting.

Instructions

Exécute une requête SQL personnalisée sur un document Grist.

Permet d'exécuter des requêtes SQL complexes avec jointures, agrégations et sous-requêtes.

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": {
      "doc_id": "<doc_id>",
      "sql_query": "<sql_query>"
    },
    "name": "execute_sql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYesID du document
sql_queryYesRequête SQL à exécuter (SELECT uniquement)
parametersNoListe des paramètres pour les placeholders '?' dans la requête
timeout_msNoDélai d'expiration en millisecondes (défaut: 1000)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.2.2
    • addedInput schema / properties / doc_id / description
      Added value: +"ID du document"
    • addedInput schema / properties / parameters / description
      Added value: +"Liste des paramètres pour les placeholders '?' dans la requête"
    • addedInput schema / properties / sql_query / description
      Added value: +"Requête SQL à exécuter (SELECT uniquement)"
    • addedInput schema / properties / timeout_ms / description
      Added value: +"Délai d'expiration en millisecondes (défaut: 1000)"
  2. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden, yet it says nothing about read-only guarantees, required permissions, row or cost limits, or how errors surface. The 1000 ms default timeout and its consequences are invisible here. Its only behavioral content is the capability claim about complex queries, which is thin for a raw SQL execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and resource, with no padding. The second sentence partly restates the first while adding the join/aggregation/subquery detail, a minor redundancy in an otherwise tight definition.

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

Completeness3/5

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

The input schema is fully described and an output schema exists, so return values and parameters need not be explained. What is missing is behavioral and routing context for an unannotated raw-SQL execution tool, making the definition minimally adequate rather than 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?

Schema description coverage is 100%, so doc_id, sql_query, parameters ('?' placeholders) and timeout_ms are already documented in the schema. The description adds no meaning about parameter binding order, timeout tuning, or query limits, so the baseline 3 applies.

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?

The description gives a specific verb and resource ('Exécute une requête SQL personnalisée sur un document Grist') and broadens it with the kinds of SQL it supports (jointures, agrégations, sous-requêtes). It is clearly distinguishable from data-manipulation siblings, though it never names filter_sql_query as the narrower alternative, so the boundary between the two remains implicit.

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?

There is no statement about when to reach for this tool versus filter_sql_query or the structured record tools, and no prerequisites or exclusions. The only constraint, 'SELECT uniquement', lives in the schema rather than the description, so the agent gets no routing guidance from the text itself.

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