Skip to main content
Glama

file.replace

Replace the full content of a vault file, using a content hash to ensure safe updates and avoid conflicts.

Instructions

HEAVY: replace the entire content of a file. Prefer str_replace / apply_patch / heading.replace_body / block.replace / frontmatter.set / lines.replace for surgical edits. Requires expected_content_hash unless create_if_missing is true and the file does not exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
vaultNo
contentYes
dry_runNo
create_if_missingNo
expected_content_hashNo
Behavior4/5

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

Despite no annotations, the description discloses the operation as 'HEAVY' and mentions hash requirement, implying destructive potential. However, it lacks details on error handling, idempotency, or permissions, which would enhance transparency.

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 concise with two sentences, front-loading the 'HEAVY' warning. Every sentence adds value: operation, alternatives, and a condition. No redundancy.

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?

Given 6 parameters, no output schema, and no annotations, the description provides only basic context. It doesn't detail return values, error states, or all parameter behaviors, leaving the tool somewhat incomplete for first-time use.

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?

With 0% schema coverage, the description should explain all 6 parameters but only covers expected_content_hash and create_if_missing. It omits 'file', 'vault', 'content', and 'dry_run', leaving significant gaps in understanding parameter semantics.

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 it replaces the entire content of a file, a specific verb and resource. It distinguishes itself from sibling tools by listing surgical alternatives, showing awareness of the tool's heavy nature.

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?

The description explicitly advises against use for surgical edits and lists alternative tools. It also specifies the requirement for expected_content_hash unless create_if_missing is true and file doesn't exist, providing clear when-to-use guidance.

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