Skip to main content
Glama

Sort CSV rows

sort_csv_rows
Read-onlyIdempotent

Stably sort data records by an explicit zero-based column using literal code-unit string order, asc or desc. Header defaults to preserved. No numeric, date or locale inference. Reject missing target columns.

Input Schema

NameRequiredDescriptionDefault
csvYesComplete UTF-8 CSV text, up to 256 KiB. All cells remain strings; formulas are never evaluated.
columnYesZero-based column index. Every data record must contain this column.
delimiterNoExplicit delimiter; no delimiter inference.,
directionNoasc
hasHeaderNoPreserve the first record as a header.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description still adds real behavior: stable sort, code-unit ordering rather than numeric/date/locale collation, header preservation by default, and that missing target columns are rejected rather than padded. It does not say what the returned value looks like (sorted CSV text) or how quoting/embedded newlines are handled.

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?

Four short sentences, front-loaded with the core operation, no filler. The telegraphic fragments ('Header defaults to preserved.', 'Reject missing target columns.') are efficient though slightly clipped in register.

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

Completeness3/5

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

This is a transformation tool with no output schema, so the description should state that it returns the sorted CSV text and how the header row behaves in the output. Ordering semantics and error behavior are covered, but the result shape is left entirely implicit.

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 coverage is 80%, so the schema already documents all five parameters well. The description reinforces only `column` (zero-based), `direction` (asc/desc) and `hasHeader` (preserved) and gives no new information about `delimiter` or the size constraint on `csv`; baseline 3 applies.

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 ('Stably sort data records by an explicit zero-based column') plus the exact comparison semantics (literal code-unit string order) and the direction axis. This is unambiguously distinct from the sibling operations edit/filter/inspect without needing to name them.

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?

Usage is implied by the operation itself (sort a CSV by a column), and 'No numeric, date or locale inference' hints at a boundary, but there is no explicit when-to-use/when-not guidance or comparison to filter_csv_rows or edit_csv_cells. The agent must infer that sorting is the alternative to filtering from the verb alone.

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.

Resources