Skip to main content
Glama

Query Grist with SQL

grist_query_sql
Read-onlyIdempotent

Run SQL queries with joins, aggregations, and complex filters on Grist documents. Supports parameterized queries for dynamic data retrieval.

Instructions

Execute SQL queries for JOINs, aggregations, and complex filters. Use grist_get_records for single-table queries without SQL. Supports parameterized q

Example: {"docId":"abc123","sql":"SELECT c.Name, o.Total FROM Customers c JOIN Orders o ON c.id = o.Customer"}

Use grist_help({tools:["grist_query_sql"]}) for full schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYes
sqlYes
parametersNo
response_formatNo
offsetNo
limitNo
Behavior4/5

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

Annotations already indicate read-only, idempotent, and open-world semantics. The description adds context about supported query types (JOINs, aggregations, complex filters) and parameterization, which complements the annotations without contradiction. No additional behavioral details are needed given the annotation coverage.

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?

The description is concise, consisting of two clear sentences plus a relevant example. Information is front-loaded and directly addresses the tool's core functionality. The example adds value but is somewhat verbose; still, it maintains overall readability.

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

Completeness2/5

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

Given the tool's complexity (SQL queries, 6 parameters, no output schema), the description is incomplete. It omits details about response_format, offset, limit, and how parameters work. The reference to external help via grist_help is a gap; the description should stand alone. It covers the essential distinction from siblings but fails to fully inform usage of optional parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 6 parameters with 0% description coverage. The description only implicitly mentions docId and sql via the example, and hints at parameterized queries for the 'parameters' array. It provides no explanation for response_format, offset, or limit, leaving significant ambiguity. The description does not compensate adequately for the lack of schema descriptions.

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 clearly states the tool executes SQL queries for JOINs, aggregations, and complex filters. It explicitly distinguishes from the sibling tool grist_get_records by stating its use for single-table queries without SQL, leaving no ambiguity about when to use this tool.

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?

The description provides explicit guidance on when to use this tool vs grist_get_records for single-table queries. It also mentions support for parameterized queries and references grist_help for full schema, though it does not specify any exclusions or prerequisites.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gwhthompson/grist-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server