Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_file_insert_lines_after_match

Insert lines after a specific line in a remote file via SSH. Useful for adding configuration directives or host entries after matching exact trimmed line content.

Instructions

Insert lines after a unique line match (ignoring leading/trailing whitespace).

PARAMETERS:

  • file_path: Path to the file to modify

  • match_line: Exact line content to match (whitespace-trimmed)

  • lines_to_insert: List of lines to insert after the match

    • To insert multiple lines: use ["first line", "second line", ...]

    • To insert a single line: use ["line to insert"]

    • To insert an empty line: use [""]

  • use_sudo: Use sudo for the operation (default: false)

  • force: Force operation even if file can't be read (sudo only) (default: false)

RETURNS: A dictionary with operation status including:

  • success: Boolean indicating if operation succeeded

  • file_path: Path to the modified file

EXAMPLES: Example 1: Insert configuration lines after a marker

{
  "file_path": "/etc/nginx/nginx.conf",
  "match_line": "http {",
  "lines_to_insert": ["    server_tokens off;", "    client_max_body_size 20M;"]
}

Example 2: Add a new host entry after localhost

{
  "file_path": "/etc/hosts",
  "match_line": "127.0.0.1 localhost",
  "lines_to_insert": ["192.168.1.10 myserver.local"]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the file to modify
match_lineYesExact line content to match
lines_to_insertYesLine(s) to insert after the match
use_sudoNoUse sudo for the operation
forceNoForce operation even if file can't be read (sudo only)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

Without annotations, the description must stand alone. It discloses whitespace trimming and mentions use_sudo and force behavior, but does not clarify what happens if the match line is not found or if multiple matches exist. The return dictionary is described, but error conditions are omitted.

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 well-structured with a purpose summary, parameter list, returns section, and examples. It is concise yet informative, though the repeating of parameter descriptions from the schema in the description body could be slightly trimmed. Overall, it is efficient.

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?

Given the presence of an output schema and high schema coverage, the description is largely complete. It covers parameters, return values, and provides practical examples. However, missing edge-case handling (e.g., match not found, file permissions) leaves a small gap.

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 the baseline is 3. The description adds value by explaining the lines_to_insert parameter's array usage (multiple lines, single line, empty line) and provides concrete examples that illustrate parameter meaning beyond the schema's brief descriptions.

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 action ('Insert lines after a unique line match') and identifies the resource ('a file'). It specifies the key constraint of ignoring leading/trailing whitespace and distinguishes from sibling tools like ssh_file_delete_line_by_content or ssh_file_replace_line by the unique insert-after-match behavior.

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?

No explicit guidance on when to use this tool versus alternatives (e.g., ssh_file_replace_line, ssh_file_delete_line_by_content). The description implies usage through its parameter details and examples but does not state conditions like 'use this when you need to add lines after a specific line match, not replace or delete'.

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

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