Skip to main content
Glama

lines.replace

Replace a specific line range in an Obsidian file, using a hash to ensure the range hasn't changed, preventing edit conflicts.

Instructions

Replace a contiguous line range (1-based, inclusive). Requires expected_range_hash returned by file.read_range or outline (section_hash).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
fileYes
fromYes
vaultNo
contentYes
dry_runNo
expected_range_hashYes
Behavior2/5

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

With no annotations, the description must disclose behavioral traits fully. It mentions the hash requirement, implying it is safe against conflicts, but does not clarify if the operation is destructive, what permissions are needed, or how hash mismatches are handled. This is insufficient given the lack of annotation coverage.

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?

The description is two sentences, front-loaded with the core purpose, and every word adds value. No fluff or repetition. It is appropriately terse for a tool that is a simple line replacement.

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

Completeness2/5

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

Given the tool's complexity (7 parameters, no output schema, no annotations), the description is incomplete. It does not explain return values, error scenarios, how to use dry_run, or the role of the vault parameter. An agent would likely need to consult external documentation or risk misuse.

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

Parameters2/5

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

The input schema has zero description coverage for its 7 parameters. The description only adds meaning to expected_range_hash (requires it and explains its origin) and implies the line range is 1-based inclusive. Other parameters like dry_run, vault, and content are not explained, leaving the agent to infer their roles from names alone. The description fails to compensate for the schema's gaps.

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 replaces a contiguous line range with 1-based inclusive indexing, which is a specific verb and resource. It distinguishes from other line operations like insert and file-level replaces, albeit implicitly. The purpose is unambiguous.

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 provides context by mentioning the required expected_range_hash and its sources (file.read_range or outline), indicating when this tool is appropriate for conflict-safe replacements. However, it does not explicitly state when not to use it or compare to sibling tools like file.replace or apply_edits, leaving room for misuse.

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/usrivastava92/obsidian-native-mcp'

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