Skip to main content
Glama

Clean table

clean_table
Read-onlyIdempotent

Clean a table: trim whitespace in cells, drop fully empty rows, and optionally remove duplicate rows; returns the table in the same format with before/after row counts. Use when preparing messy pasted data. Do NOT use to change format; use convert_table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe whole table as text, first row = header. CSV/TSV text (quoted cells allowed), or a JSON array of flat objects, e.g. "name,age\nAsha,30".
trimNoTrim leading/trailing whitespace in every cell. Default true.
dedupeNoRemove exact duplicate data rows, keeping the first. Default false.
formatNoFormat of 'data' and of the returned table: csv, tsv or json. Default csv.
drop_empty_rowsNoRemove rows whose cells are all empty. Default true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe cleaned table as text in the input format.
rows_afterYesData rows after cleaning (excluding header).
rows_beforeYesData rows before cleaning (excluding header).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changed
    • changedInput schema / properties / data / description
      Previous value: -"The data for this request."New value: +"The whole table as text, first row = header. CSV/TSV text (quoted cells allowed), or a JSON array of flat objects, e.g. \"name,age\\nAsha,30\"."
    • addedInput schema / properties / data / minLength
      Added value: +1
    • changedInput schema / properties / dedupe / description
      Previous value: -"Set true to enable dedupe; false otherwise."New value: +"Remove exact duplicate data rows, keeping the first. Default false."
    • changedInput schema / properties / drop_empty_rows / description
      Previous value: -"Set true to enable drop empty rows; false otherwise."New value: +"Remove rows whose cells are all empty. Default true."
    • changedInput schema / properties / format / description
      Previous value: -"The format for this request."New value: +"Format of 'data' and of the returned table: csv, tsv or json. Default csv."
    • addedInput schema / properties / format / enum
      Added value: +[
      +  "csv",
      +  "tsv",
      +  "json"
      +]
    • changedInput schema / properties / trim / description
      Previous value: -"Set true to enable trim; false otherwise."New value: +"Trim leading/trailing whitespace in every cell. Default true."
    • removedOutput schema / properties / cleaned_data
      Removed value: -{
      -  "description": "The cleaned table string with trimmed cells, empty rows dropped, and duplicate rows removed.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / rows_after
      Added value: +{
      +  "description": "Data rows after cleaning (excluding header).",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / rows_before
      Added value: +{
      +  "description": "Data rows before cleaning (excluding header).",
      +  "type": "integer"
      +}
    • removedOutput schema / properties / rows_dropped
      Removed value: -{
      -  "description": "The number of empty rows that were dropped from the table.",
      -  "type": "integer"
      -}
    • removedOutput schema / properties / rows_duplicated
      Removed value: -{
      -  "description": "The number of duplicate rows that were removed from the table.",
      -  "type": "integer"
      -}
    • addedOutput schema / properties / text
      Added value: +{
      +  "description": "The cleaned table as text in the input format.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "cleaned_data"
      -]New value: +[
      +  "text",
      +  "rows_before",
      +  "rows_after"
      +]
  2. Changed5 schema fields changed
    • addedInput schema / properties / data / description
      Added value: +"The data for this request."
    • addedInput schema / properties / dedupe / description
      Added value: +"Set true to enable dedupe; false otherwise."
    • addedInput schema / properties / drop_empty_rows / description
      Added value: +"Set true to enable drop empty rows; false otherwise."
    • addedInput schema / properties / format / description
      Added value: +"The format for this request."
    • addedInput schema / properties / trim / description
      Added value: +"Set true to enable trim; false otherwise."
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "cleaned_data": {
      +      "description": "The cleaned table string with trimmed cells, empty rows dropped, and duplicate rows removed.",
      +      "type": "string"
      +    },
      +    "rows_dropped": {
      +      "description": "The number of empty rows that were dropped from the table.",
      +      "type": "integer"
      +    },
      +    "rows_duplicated": {
      +      "description": "The number of duplicate rows that were removed from the table.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "cleaned_data"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds real behavioral context beyond them: output preserves the input format and reports before/after row counts, which tells the agent the operation is non-shape-changing. It stops short of noting that cleaning never alters column structure or header handling, so not quite a 5.

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?

Front-loads the operation list in a single dense clause, then two short sentences for usage and the exclusion. No filler, and the most decision-relevant routing information (do not use for format conversion) is stated last but in one clause.

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?

With an output schema present, the description need not explain return values, and it still mentions the row-count summary. Purpose, scope, defaults implied by the schema, and the sibling alternative are all covered, so an agent has everything needed to call it correctly.

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 every parameter (trim, dedupe, format, drop_empty_rows, data) is already documented with defaults and the enum in the schema. The description restates the three cleaning behaviors but adds no format syntax or edge-case semantics beyond it, which is the expected baseline when the schema does the heavy lifting.

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?

Names a specific verb (clean) and resource (table) and enumerates the exact operations performed: trim whitespace, drop fully empty rows, optionally dedupe. It also explicitly distinguishes itself from convert_table, so an agent can separate it from the sibling without opening either schema.

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?

States the triggering context ('when preparing messy pasted data') and an explicit exclusion plus the alternative ('Do NOT use to change format; use convert_table'). Both the when and the when-not are present, which is the top of the scale.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.