Skip to main content
Glama

query_data

Execute DuckDB SQL queries on CSV, Parquet, and JSON files to aggregate, join, and analyze data for targeted insights.

Instructions

Execute a DuckDB SQL query on data files (CSV, Parquet, JSON) to gain deeper insights.

CRITICAL: This is your PRIMARY tool for advanced data exploration.
- Use this to aggregate data (GROUP BY), join multiple files, calculate derived metrics, or inspect specific subsets.
- Prefer this over 'inspect_data' when you need to answer specific questions about the data distribution or relationships.
- You can query files directly in the FROM clause, e.g., "SELECT category, AVG(price) FROM 'data.csv' GROUP BY category".

- NOTE: Please use absolute paths for files in your FROM clause to avoid path resolution errors.

Args:
    query: Standard DuckDB SQL query.
    
Returns:
    JSON string containing the query results (limit 100 rows).

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": {
      "query": "<query>"
    },
    "name": "query_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It does add real value: the 100-row result limit, JSON string return, and the absolute-path requirement in the FROM clause. However, it never states whether arbitrary DuckDB statements that mutate state (COPY, INSERT, CREATE) are permitted or blocked, nor anything about timeouts, error behavior, or file-access scope — significant omissions for an unrestricted 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?

Front-loaded with the one-line purpose, then bulleted guidance, an inline example, and an Args/Returns block — easy to scan. Minor waste from the 'CRITICAL: This is your PRIMARY tool' emphasis and 'to gain deeper insights', which add tone rather than information.

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 shape need not be spelled out, and with a single required parameter the surface is simple. Purpose, usage, an example, and the path pitfall are all covered; the remaining gap is the absence of any statement about read-only enforcement or query limits, which matters given zero annotation coverage.

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%, so the description must compensate, and it does: it defines the parameter as a 'Standard DuckDB SQL query' and supplies a concrete example showing that file paths go directly in the FROM clause. The absolute-path warning adds operational meaning the schema lacks, though it does not address statement-type restrictions or quoting edge cases.

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 DuckDB SQL query over CSV, Parquet, and JSON files. It also names the sibling it supersedes ('Prefer this over inspect_data') for the analytical case, so an agent can distinguish the two without opening schemas. The trailing 'to gain deeper insights' is vague but does not dilute the concrete core.

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 enumerates the when-to-use conditions: aggregation with GROUP BY, joining multiple files, derived metrics, and inspecting specific subsets. It also names the alternative (inspect_data) and the condition that selects this tool over it — answering specific questions about distribution or relationships.

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