Skip to main content
Glama

fold

Read-only

Wrap long input lines to a fixed character width by breaking at exact positions. Returns structured JSON output.

Instructions

Wrap long input lines at a fixed character width, breaking at exact positions. Read-only, no side effects. Returns JSON with wrapped text by default; use --raw for plain output. Use for display-constrained formatting or terminal-width adaptation. Not for paragraph-aware reflowing — use 'fmt' to preserve paragraph structure. See also 'fmt'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
break_wordsNoBreak words longer than the width.
encodingNoText encoding.utf-8
max_linesNoMaximum JSON lines to emit.
pathsNoFiles to fold, or '-' for stdin. Defaults to stdin.
rawNoWrite folded text without a JSON envelope.
widthNoMaximum line width.
Behavior5/5

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

Annotations already show readOnlyHint=true. The description adds: 'Read-only, no side effects.' and explains output format: 'Returns JSON with wrapped text by default; use --raw for plain output.' No contradictions; additional behavioral traits are disclosed.

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?

Four sentences, each essential. First sentence defines purpose, second declares safety, third explains output format, fourth provides usage guidance and comparison. Front-loaded with core action. No redundant words.

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?

For a simple tool with full schema coverage and annotations, the description covers purpose, safety, output format, usage context, and alternative. No output schema exists, but the return format is described. Everything needed for correct invocation is present.

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 100%, so baseline is 3. The description adds value by explaining that '--raw' produces plain output (schema says 'Write folded text without a JSON envelope', which is more technical). It also mentions 'width' and 'break_words' implicitly. This enhances understanding 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 'Wrap long input lines at a fixed character width, breaking at exact positions.' It distinguishes from sibling 'fmt' by explicitly stating it is not for paragraph-aware reflowing and references 'fmt' as the alternative. The verb and resource are specific.

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 says when to use: 'Use for display-constrained formatting or terminal-width adaptation.' Provides exclusion: 'Not for paragraph-aware reflowing — use 'fmt' to preserve paragraph structure.' Names the sibling alternative 'fmt'.

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