Skip to main content
Glama

edit_document

Replace a specified string in a document with new text to update its content.

Instructions

Edit a document by replacing a string in the documents content with a new string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYesId of the document that will be edited
new_strYesThe new text to insert in place of the old text
old_strYesThe text to replace. Must match exactly, including whitespace
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral details such as whether all occurrences are replaced, behavior when old_str is not found, return value, or any side effects. The schema mentions exact matching, but that is in the parameter description, not the tool description.

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?

The description is a single sentence with no fluff, but it contains a minor typo ('documents') and could be slightly clearer about the target content. Overall, it is concise and front-loaded.

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 simple mutation tool, the description covers the core operation but omits important context like return value, behavior on no match, and whether replacement is global. Given no output schema, including such details would make the description more complete.

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?

The input schema provides full descriptions for all three parameters (doc_id, old_str, new_str) with 100% coverage. The tool description only rephrases the replace operation without adding new meaning to the parameters, so it meets the baseline for schema-covered parameters.

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 uses a specific verb 'edit' with resource 'document' and clarifies the mechanism ('replacing a string with a new string'). This clearly distinguishes it from the sibling read_doc_contents.

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 implies the tool is for modifying document content by string replacement, but it does not explicitly state when to use it versus reading, nor any exclusions or alternative tools. With only a read sibling, some guidance would improve clarity.

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/dspenard/claude_mcp_chat_cli'

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