Skip to main content
Glama

csplit

Destructive

Partition data by content patterns: split input at each regex match, generating separate output files. Use dry-run to preview split points without writing.

Instructions

Split input into multiple files at regex match points with dry-run and overwrite protection. Destructive: creates output files on the filesystem. Use --dry_run to preview split points without creating files. Returns JSON with generated filenames and record counts. Use to partition data by content patterns. Not for fixed-size splitting — use 'split' for line-count or byte-size chunks. See also 'split'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allow_overwriteNoAllow replacing existing outputs.
dry_runNoReport split outputs without writing files.
encodingNoText encoding.utf-8
max_splitsNoMaximum regex matches to split at; 0 means all.
output_dirNoDirectory for split outputs..
pathYesFile to split, or '-' for stdin.
patternNoRegular expression; each match starts a new chunk.
prefixNoOutput file prefix.xx
suffix_lengthNoNumeric suffix length.
Behavior4/5

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

The description warns 'Destructive: creates output files on the filesystem', reinforcing the destructiveHint annotation. It also highlights the dry_run option to preview. However, it does not detail overwrite behavior beyond the parameter.

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?

Five sentences are front-loaded with purpose and warning, no redundant information. Every sentence adds value.

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?

Given the complexity (9 parameters, no output schema), the description covers purpose, usage, destructive nature, dry-run, return format, and differentiation from sibling. It feels complete for agent decision-making.

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?

All 9 parameters have schema descriptions (100% coverage), so baseline is 3. The description adds context for dry_run and mentions return format, but does not add significant meaning beyond the 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 the tool splits input files at regex match points, distinguishing it from 'split' which does fixed-size splitting. It specifies the method (regex) and scope (multiple files).

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 tells when to use (partition by content patterns) and when not to (fixed-size splitting), pointing to the sibling 'split' tool. Also mentions dry-run for previewing without creation.

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/caseSHY/AI-CLI'

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