Skip to main content
Glama

Edit DAT content (surgical)

edit_dat_content
Destructive

Replace a substring in a Text or Table DAT's .text. Requires exactly one match unless replace_all is enabled.

Instructions

Surgically replace a substring inside a Text or Table DAT's .text. Without replace_all, requires exactly one match — 0 or >1 occurrences is an error, forcing the caller to add context or set replace_all. Use set_dat_content to overwrite an entire DAT's text in place; use this to make a targeted edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dat_pathYesAbsolute path to the Text or Table DAT to edit (e.g. '/project1/mytext1').
old_stringYesExact substring to find. Must match at least once. Empty strings are rejected.
new_stringYesReplacement text. May be empty to delete the matched substring.
replace_allNoWhen false (default), requires exactly one match — 0 or >1 occurrences is an error. Set true to replace every occurrence.
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it explains the exact matching requirements (exactly one match without `replace_all`), error scenarios (0 or >1 matches), and that it's a surgical edit. Annotations already indicate destructive and open-world, and the description complements these without contradiction.

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 three sentences, front-loaded with the primary action. Every sentence serves a purpose: action, behavior details, and sibling differentiation. No wasted words.

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

Completeness4/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 sufficiently covers behavioral aspects including error conditions and usage context. It could optionally mention that no output is returned on success, but the current detail is adequate for a mutation tool.

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% with clear param descriptions, but the tool description enhances understanding by explaining how `replace_all` affects matching behavior and the requirement for exact match. This adds value beyond the schema alone.

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's purpose: replace a substring inside a DAT's .text. It uses specific verbs ('replace') and resources ('substring inside a Text or Table DAT's .text'), and distinguishes from the sibling tool `set_dat_content` which overwrites the entire text.

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?

Explicitly tells when to use this tool vs `set_dat_content`: 'Use set_dat_content to overwrite an entire DAT's text in place; use this to make a targeted edit.' Also explains the `replace_all` behavior and error conditions, guiding the agent on proper usage.

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/Pantani/tdmcp'

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