Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_file_delete_line_by_content

Delete one exact line from a remote file over SSH by matching its full content. Fails safely if the line is missing or not unique.

Instructions

Delete a line by its exact content. match_line must match EXACTLY ONE line in the file (whitespace-trimmed, literal text - not a pattern); if it matches zero lines or more than one, the operation fails with a descriptive error rather than guessing which line(s) to delete. Use ssh_file_find_lines_with_pattern first if you're not sure the line is unique. (Equivalent to ssh_file_replace_line_multi(new_lines=[]), provided as a clearer-named shortcut.)

Returns: On success: {'success': True} (no count field - only ever deletes the one matched line). On failure (match not found, match not unique, file not found/unreadable): {'success': False, 'error': str} - not a raised exception.

Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoNo longer needed (kept for compatibility): with use_sudo=true the file is read with sudo when the user can't read it. If it can't be read at all, the edit fails - it never reports success without having seen the file.
use_sudoNoUse sudo for the operation
file_pathYesPath to the file to modify
match_lineYesExact line content to match and delete

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.1
    • changedInput schema / properties / force / description
      Previous value: -"Force operation even if file can't be read (sudo only)"New value: +"No longer needed (kept for compatibility): with use_sudo=true the file is read with sudo when the user can't read it. If it can't be read at all, the edit fails - it never reports success without having seen the file."
  2. First observedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: uniqueness constraint, zero/multi-match failure behavior, error returned as a value rather than a raised exception, sudo read semantics, the 50s wait cap with {'status': 'in_progress', 'handle_id'} fallback, the single-concurrent-operation 'busy' error, and the polling tool. This is far beyond what the schema conveys.

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?

Front-loads the core action and the uniqueness rule, then uses labeled sections for Returns and Long-running calls. It is longer than typical, but the structure is clear and each block (error contract, wait-cap behavior) carries distinct information, so little is wasted.

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

Completeness5/5

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

For a mutation tool with sudo options and long-running support, the description covers failure modes, return shape, concurrency limits, and async polling. Despite an output schema existing, the extra detail on the non-obvious in_progress/busy behavior leaves nothing an agent needs missing.

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, but the description adds real semantics: match_line is 'whitespace-trimmed, literal text - not a pattern' and must match exactly one line. It also explains the deprecated force/use_sudo read behavior. Meaningful value over the schema's one-line parameter 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?

States a specific verb and resource ('Delete a line by its exact content') and pins down the matching semantics precisely. It distinguishes itself from ssh_file_replace_line by naming the equivalence and from ssh_file_find_lines_with_pattern by pointing to it as a prerequisite. An agent can select it without opening any schema.

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

Usage Guidelines5/5

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

Explicitly says to run ssh_file_find_lines_with_pattern first if uniqueness is uncertain, and explains what happens when the match is not unique. It also clarifies this is a shortcut for ssh_file_replace_line_multi(new_lines=[]), giving a clear alternative and the condition that selects each.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.