Skip to main content
Glama

write_file

Create or replace a Markdown note with YAML metadata, including automatic parent link validation and index refresh. Use content_lock to update only metadata while preserving existing content.

Instructions

Create or replace one Markdown note with YAML metadata. Use it when an agent has an explicit final content body and metadata to save. This is a destructive write: it replaces the complete file, unless content_lock=true is used to preserve the existing body and update only metadata. Before writing, the server validates that parent links do not create graph cycles, syncs parents and parents_meta, and then refreshes the local index. Use read_file first for existing notes and suggest_metadata first when you want classification hints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRelative path from OBSIDIAN_ROOT
contentYesMarkdown body (without frontmatter delimiters)
metadataNoYAML frontmatter to write for the note.
content_lockNoIf true, IGNORE content param and preserve original file text. Default false.
Behavior5/5

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

The description discloses destructive behavior: 'this is a destructive write: it replaces the complete file, unless content_lock=true.' It also explains server-side validations (graph cycle checking, parent/metadata syncing, index refresh) beyond what annotations provide (none). No contradictions.

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—five sentences—with each sentence serving a distinct purpose: purpose, usage, destructive nature, validation steps, and alternative tool guidance. No redundant or irrelevant information.

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?

Given no output schema, the description covers the tool's action, parameters, side effects, and contextual usage with siblings. The 4 parameters and nested metadata object are well explained. The behavioral details (content_lock, validations) ensure an agent can use it safely.

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 baseline is 3. The description adds behavioral context for content_lock (preserving body, updating only metadata) and the order of operations for metadata fields. However, the schema already describes parameters adequately, so the added value is moderate.

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 opens with 'Create or replace one Markdown note with YAML metadata,' clearly stating the action (create/replace) and the resource (Markdown note with YAML metadata). It distinguishes from siblings by naming read_file and suggest_metadata as alternatives for different needs.

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 states when to use the tool: 'when an agent has an explicit final content body and metadata to save.' It also contrasts with read_file and suggest_metadata, providing clear guidance on when not to use it and what to use instead.

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/Semiotronika/NOUZ-MCP'

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