Skip to main content
Glama

ssh_replace_lines

Replace or delete a range of lines in a file on a remote server directly via sed, with no full-file transfer needed.

Instructions

Replace a range of lines in a file on the remote server.

Operates directly via sed on the remote — no full-file transfer needed. If content is empty, the lines are deleted. Both start_line and end_line are 1-based and inclusive.

Args: path: Path to the file on the remote. start_line: First line to replace (1-based, inclusive). end_line: Last line to replace (1-based, inclusive). content: Replacement text. Empty string deletes the line range. host: SSH host alias from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
start_lineYes
end_lineYes
contentNo
hostNo
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that it uses sed on the remote and that empty content deletes lines. However, it does not mention error handling (e.g., file not found, invalid line numbers), permissions, or side effects. This leaves important 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear main sentence, a behavioral detail sentence, and an Args list. Every sentence adds value. However, the Args list repeats information already in the schema titles; a more structured format could improve scannability.

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?

Given no output schema, the description should mention what the tool returns (e.g., success message, modified content, or error details). It also lacks details about required permissions or edge cases (e.g., start_line > end_line). These gaps make it less complete for an agent to use confidently.

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?

Schema coverage is 0%, so the description must clarify parameter meaning. It explicitly explains each parameter: path, start_line/end_line (1-based, inclusive), content (empty deletes), and host (defaults). This adds substantial value beyond the schema titles and types.

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 action ('replace a range of lines') and the resource ('in a file on the remote server'). It distinguishes from sibling tools like ssh_insert_lines and ssh_write_file by specifying the operation is a range replacement, not an insert or full write.

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?

The description provides some usage context (operates via sed, no full-file transfer) but does not explicitly state when to use this tool versus siblings like ssh_insert_lines or ssh_write_file. The guidance is implicit rather than explicit, which may leave an AI agent uncertain about trade-offs.

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/mkavinkumar1/ssh-mcp'

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