Skip to main content
Glama

replace_lines

Replace or delete a specific range of lines in an Obsidian note by specifying 1-based start and end lines; use empty content to remove the range.

Instructions

Replace (or delete, with empty content) a range of lines (1-based, inclusive).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file": "<file>",
      "start_line": "<start_line>",
      "end_line": "<end_line>",
      "content": "<content>"
    },
    "name": "replace_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesNote path ("Folder/Note.md"), path without .md, note name, alias, or [[wikilink]]
vaultNoVault name, id or folder path (see list_vaults). Default: OBSIDIAN_VAULT or the vault open in Obsidian.
contentYes
end_lineYes
start_lineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior1/5

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

The description explicitly advertises deleting a range of lines, while the annotations declare destructiveHint=false. That is a direct conflict about whether the tool can destroy content. Beyond the conflict, the description says nothing about behavior on out-of-range lines, partial failures, or whether the file must already exist.

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?

A single sentence with no waste, and the core operation plus the deletion variant are front-loaded. Nothing extraneous.

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?

For a 5-parameter mutation tool with no output schema, the definition covers the key semantics but leaves gaps: no statement about behavior when the range exceeds the file length, whether the file is created if missing, or what the result looks like.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 40% and content, start_line, and end_line carry no schema descriptions. The description compensates well for the range parameters by specifying '1-based, inclusive' and for content by defining empty content as deletion. The file and vault parameters are already documented in the schema, so the added value is partial but meaningful.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — replacing a range of lines — plus the delete variant, so an agent knows exactly what operation it performs. It does not distinguish this from siblings such as replace_in_note or batch_replace, which is the only thing keeping it from a 5.

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?

Usage is implied rather than spelled out: the parenthetical 'delete, with empty content' tells the agent how to achieve deletion, which is a real usage hint. But there is no guidance on when to choose this over replace_in_note or batch_replace, nor on prerequisites such as the file existing.

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

Deploy Server

Other Tools