Skip to main content
Glama

edit_doc_contents

Replace a specific text string within a document using its ID, providing the exact old text and the new replacement to update the file's content.

Instructions

Edit a document by replacing a string in the documents content with the 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 test to replace. Must match exactly, including whitespaces
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It does not mention destructive nature, behavior when old_str is not found, case sensitivity, or side effects. The exact-match requirement appears only in the schema, not the description.

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 a single sentence with the verb front-loaded and no wasted words. It is concise and easily scanned.

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?

The tool has no output schema and no annotations, so the description should explain return values and edge cases. It omits what happens on success/failure, whether it replaces all occurrences, and any prerequisites, making it incomplete for a mutation tool.

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 description coverage is 100%, so baseline is 3. The description does not add extra meaning beyond what the schema already provides for doc_id, old_str, and new_str.

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 edits a document by replacing a string, using the specific verb 'Edit' with the resource 'document' and the operation 'replacing a string'. This distinguishes it from sibling tools like read_doc_contents (read) and add_ints (arithmetic).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs. alternatives, no prerequisites, and no exclusions. The description merely states the action without context on appropriate usage scenarios.

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/gfalbarracinr/cli_project'

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