Skip to main content
Glama
JEL-LL

file_utils MCP

by JEL-LL

insert_at

Insert content before or after a target line in a file using an anchor substring or line number, without replacing existing text.

Instructions

Insert content before or after a single target line (anchor or line number) without replacing existing content. Writes atomically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or workspace-relative path to the file.
anchorNoTarget line (substring, case-sensitive). Mutually exclusive with line_number.
encodingNoFile encoding. Default: utf-8. Pass utf-8-sig to strip a BOM.utf-8
positionNoWhere to splice relative to the target line.after
line_numberNoTarget line (positive = 1-based, negative = from end). Mutually exclusive with anchor.
new_contentYesText to insert, written byte-for-byte. The caller is responsible for any line endings needed to keep the insertion on its own line.
anchor_totalNoExpected total occurrences of anchor in the file.
project_rootNoSets (and remembers) the project root for resolving relative paths for this and subsequent calls in the session.
anchor_occurrenceNoWhich occurrence of anchor to use (1-based).
expected_content_hashNoSHA-256 hex digest of the target line's raw bytes (including its terminator). Rejected with HASH_MISMATCH if it doesn't match.
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses atomic writing and the non-replacing nature, but doesn't mention error handling (e.g., anchor not found, hash mismatch), permissions, or whether the file is created if missing. This leaves significant behavioral gaps for a mutation tool.

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 two concise sentences, front-loaded with the core purpose and a key behavioral detail (atomicity). No redundant or irrelevant information.

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

Completeness2/5

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

With 10 parameters and no annotations or output schema, the description is too sparse to provide sufficient context. It doesn't explain when to use anchor vs line_number, tie the parameters together, or describe failure modes, leaving the agent to infer from schema alone.

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?

The schema already provides complete descriptions for all 10 parameters (100% coverage), so the baseline is 3. The tool description doesn't add any extra parameter semantics beyond the schema, so it remains at baseline.

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's function: inserting content before or after a specific target line without replacing existing content. It distinguishes itself from replacing or prepending/appending tools by emphasizing the targeted insertion and atomic write.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for inserting at a specific line in the middle of a file, distinguishing it from prepend/append. However, it doesn't explicitly mention alternative tools or provide exclusions beyond 'without replacing existing content.'

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/JEL-LL/file_utils'

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