Skip to main content
Glama

clean_dataset

Apply cleaning operations like dropping duplicates, filling missing values, renaming columns, and more to a dataset, writing a cleaned copy without modifying the original.

Instructions

Apply cleaning operations to a dataset and write a new file.

NEVER modifies the original file. Always writes to output_path.

Supported operations:
  - "drop_duplicates"                    — remove exact duplicate rows
  - "drop_columns:[col1:col2:...]"       — remove specified columns
  - "fill_na:[col:value]"                — fill nulls in col with value
  - "rename_column:[old_name:new_name]"  — rename a column
  - "strip_whitespace"                   — strip leading/trailing spaces from all string columns
  - "standardize_dates:[col:format]"     — parse col as date (format: 'auto' or strftime)
  - "drop_na_rows:[col]"                 — drop rows where col is null
  - "drop_na_rows_any"                   — drop rows with ANY null value

Args:
    path:         Absolute local path to the source dataset.
    operations:   List of operation strings (see above).
    output_path:  Where to write the cleaned file. If empty, appends '_cleaned'
                  before the extension (e.g. data.csv → data_cleaned.csv).

Returns JSON with: output_path, original_shape, cleaned_shape, row_delta,
col_delta, operations_applied, operations_skipped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
operationsYes
output_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations exist, so description carries full burden. It explicitly states NEVER modifies original file, always writes to output_path, default naming convention, and describes the return JSON structure. This fully discloses behavioral traits.

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?

Well-structured: first line purpose, then immutability note, then bulleted operation list with syntax, then parameter descriptions, then return value. Every sentence adds value without wordiness.

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

Completeness5/5

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

Despite 0% schema description coverage and no annotations, the description is fully complete. It explains all operations with syntax, parameters with defaults, and return JSON. Output schema provides additional structure but description suffices.

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

Parameters5/5

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

Schema description coverage is 0%, so description compensates completely. It explains path as absolute local path, operations as list of operation strings with examples, and output_path with default behavior. Adds full meaning beyond schema.

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 it applies cleaning operations to a dataset and writes a new file. It lists all supported operations and explicitly states it never modifies the original file. This effectively distinguishes it from sibling tools like 'suggest_cleaning' or 'profile_dataset'.

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?

The description explains when to use (cleaning a dataset) but does not explicitly mention alternatives or when not to use. While it implies immutability, it does not contrast with other data manipulation tools among siblings.

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/SVerITG/Metis_PH'

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