Skip to main content
Glama

process_data

Run DuckDB SQL queries to clean, transform, and feature-engineer datasets, then save results to CSV, Parquet, or JSON for AutoML.

Instructions

Execute a DuckDB SQL query to transform data and save it to a new file.

CRITICAL: This is your PRIMARY tool for Feature Engineering and Data Cleaning.
- Use this to create new features, clean dirty data, handle missing values (COALESCE), or join datasets.
- You MUST use this tool to prepare the data before training if feature engineering is needed.
- Example: "SELECT *, price/sqft as price_per_sqft, COALESCE(garage, 0) as garage_clean FROM 'train.csv'"

IMPORTANT: Strongly RECOMMEND using '.parquet' extension for output_path (e.g. 'clean_data.parquet'). 
- Parquet preserves data types (int, float, string, date) much better than CSV.
- CSV often loses type information (everything becomes string or inferred incorrectly).

- NOTE: Please use absolute paths for files in your query and for output_path to avoid path resolution errors.

Args:
    query: Standard DuckDB SQL query.
    output_path: Absolute path to save the result (must be .csv, .parquet, or .json).
    
Returns:
    Confirmation message with the output path.

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>",
      "output_path": "<output_path>"
    },
    "name": "process_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
output_pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses type-preservation differences between parquet and CSV, path-resolution pitfalls with relative paths, the accepted output extensions, and that a confirmation message is returned. It never states what happens if output_path already exists (overwrite vs. error), size/row limits, or failure behavior for invalid SQL, which are material unknowns for a write 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?

The opening sentence is front-loaded and the request is scannable thanks to short bullets and a clear Args/Returns block. Some emphasis stacking (CRITICAL, IMPORTANT, Strongly RECOMMEND) and the parquet-vs-CSV rationale repeat the same point in two bullets, which could be tightened without losing 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?

Two required parameters are both explained, an output schema exists so return values need no elaboration, and the parquet/absolute-path guidance covers the most common failure modes. The remaining gap is mutation semantics on an existing output_path, the one thing an agent really cannot infer from the schema or output declaration.

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 supply meaning, and it largely does: query is characterized as standard DuckDB SQL with a real example including quoted file sources, and output_path gets an absolute-path rule plus an enumerated set of valid extensions and a format recommendation. It stops short of documenting the exact return shape or whether the SQL may reference arbitrary external files beyond the example.

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 first line gives a specific verb and resource: execute a DuckDB SQL query to transform data and write it to a new file. That "saves to a new file" framing implicitly separates it from query_data/inspect_data, but no sibling is named explicitly, so an agent must infer the boundary rather than being told it.

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?

Guidance is concrete: use it for feature creation, cleaning, COALESCE handling, and joins, and it is mandatory before training when feature engineering is needed, backed by a worked SQL example. What is missing is the negative case – when to prefer query_data or inspect_data instead of writing an output file.

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