Skip to main content
Glama

ssh_insert_lines

Insert text after a specific line in a remote file via SSH. Specify file path, line number, and content; only new content is sent.

Instructions

Insert text after a specific line number in a file on the remote server.

Operates directly via sed on the remote — no full-file transfer needed. Only the new content is sent over the wire.

Args: path: Path to the file on the remote. after_line: Line number to insert after (1-based). Use 0 to insert at the beginning. content: Text content to insert. host: SSH host alias from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
after_lineYes
contentYes
hostNo
Behavior3/5

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

Discloses operational detail (uses sed, only new content sent) but does not address error handling, permission requirements, or behavior for invalid line numbers. No annotations provided, so description carries full burden.

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?

Concise and well-structured: brief operational summary followed by clear parameter list. No unnecessary words.

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

Completeness4/5

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

Covers mechanism and parameters well. Lacks return value or error behavior, but for a simple insertion tool, this is adequate given parameter thoroughness.

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 0%, but description explains all parameters: path, after_line (1-based, 0 for beginning), content, host (optional with default). Adds crucial context beyond names.

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?

Clearly states verb (insert), resource (file on remote server), and insertion point (after a specific line number). Distinguishes from sibling tools like ssh_append_file and ssh_replace_lines.

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?

Hints at efficiency (no full-file transfer) but does not explicitly guide when to use vs alternatives or mention when not to use. Lacks clear differentiation from siblings.

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