Skip to main content
Glama

manage_line_endings

DestructiveIdempotent

Detect or fix line endings in files. Reports dominant style (LF/CRLF/mixed) and converts to your chosen style, preserving BOM.

Instructions

Detect or fix line endings. action="detect" reports the dominant style (crlf/lf/mixed/none), total lines, and the line numbers that disagree — use it when a file looks inconsistent. action="convert" rewrites the file to style, per code unit for UTF-16 and preserving its BOM; no-op if the file already matches. Parameters: path, action ("detect"|"convert"), style ("lf"|"crlf", required for convert), encoding (auto-detected, including most BOM-less UTF-16 — pass utf-16-le/utf-16-be if a very short or unusual file is misread). Example: {"path": "D:\src\unit1.pas", "action": "convert", "style": "crlf"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
styleNo
actionYes
encodingNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleYes
changedNo
messageNo
totalLinesNo
linesChangedNo
originalStyleNo
inconsistentLinesNo
Behavior5/5

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

Beyond the annotations, the description reveals important behaviors: rewriting the file for convert, no-op when the file already matches (idempotency), preservation of BOM, auto-detection of encoding, and potential misreading for short files. This adds significant context that annotations alone do not provide.

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?

The description is front-loaded with the core purpose and uses concise, informative sentences. It packs a lot of detail without redundancy, and the example is well-placed. Every sentence contributes meaningful information.

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 tool's complexity (two actions, encoding nuances, BOM handling), the description covers all necessary aspects: return values for detect (style, total lines, line numbers), convert behavior, parameter details, and example usage. It is complete for an agent to invoke correctly.

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?

The schema has no descriptions and 0% coverage, but the description explains every parameter: path, action (with valid values), style (required for convert), and encoding (with auto-detection and fallback options). The example ties them together, fully compensating for the schema's lack of detail.

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 opens with 'Detect or fix line endings', which clearly states the verb and resource. It distinguishes between two actions (detect and convert) and provides details on what each does, making it distinct from sibling tools like convert_encoding or manage_bom.

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?

It explicitly states when to use detect ('use it when a file looks inconsistent') and describes the convert behavior with encoding and BOM handling. It also gives an example, making usage clear, though it does not mention alternative tools directly. The context is sufficient for an agent to decide when to invoke it.

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/dimitar-grigorov/mcp-file-tools'

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