Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_file_replace_line_multi

Replace a matching line in a file with a list of new lines via SSH. Options to delete the line or insert an empty line.

Instructions

Replace a unique line in a file with multiple new lines.

PARAMETERS:

  • file_path: Path to the file to modify

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

  • new_lines: List of new lines to insert in place of the match

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

    • To delete the line entirely: use [] (empty list)

    • To replace with 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: Replace a line with multiple lines

{
  "file_path": "/etc/hosts",
  "match_line": "127.0.0.1 localhost",
  "new_lines": ["127.0.0.1 localhost", "127.0.0.1 myhost.local"]
}

Example 2: Delete a line entirely

{
  "file_path": "/etc/nginx/nginx.conf",
  "match_line": "# server_tokens off;",
  "new_lines": []
}

Example 3: Replace with an empty line

{
  "file_path": "/etc/ssh/sshd_config",
  "match_line": "PermitRootLogin yes",
  "new_lines": [""]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the file to modify
match_lineYesExact line content to match and replace
new_linesYesList of new lines to insert in place of 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

Behavior4/5

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

No annotations exist, so the description carries the burden. It discloses the operation's effect (modifying file by matching exact line, replacing with list), explains sudo/force options, and returns success status. No contradictions noted.

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-organized with sections for purpose, parameters, returns, and examples. It is slightly lengthy but every part is informative and relevant. No unnecessary content.

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 simple output schema (success, file_path), the description covers essential behavior including parameter variants and return format. It does not mention error handling, but for this tool's complexity it is adequate.

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%, but the description adds value beyond schema by explaining special cases: deleting with empty list, inserting blank line, and providing detailed examples. This enriches parameter understanding.

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 uses a specific verb 'replace' and clearly states the resource 'a unique line in a file' with the outcome 'multiple new lines'. It distinguishes itself from siblings like ssh_file_replace_line (for single line) and ssh_file_delete_line_by_content.

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 does not explicitly state when to use this tool versus alternatives. While examples imply usage for multi-line replacement, no direct comparison or exclusion criteria are provided. Siblings like ssh_file_replace_line serve a similar but different purpose.

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