Skip to main content
Glama

Edit DAT content (surgical)

edit_dat_content
Destructive

Replace a substring in a Text or Table DAT's content. Requires exactly one match unless replace_all is enabled, ensuring targeted edits.

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.
Behavior4/5

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

Annotations already indicate destructiveHint=true, so the description adds context about the default single-match requirement and error behavior. It does not detail permissions or reversibility, but the annotations cover the safety profile adequately.

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?

Two focused sentences with an additional explanatory clause. Every sentence adds value without redundancy. The key action is front-loaded with 'surgically replace a substring'.

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?

With no output schema, the description should hint at the return value (e.g., success/error). It explains error conditions but does not mention what the tool returns upon success. Overall, it is mostly complete 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%, and the description adds meaning by explaining that old_string must match at least once, new_string can be empty to delete, and replace_all defaults to false. This goes beyond the schema's parameter descriptions.

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 'surgically replaces a substring' in a DAT's .text, distinguishing it from the sibling tool set_dat_content which overwrites the entire text. It provides specific behavior details about the replacement operation.

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 contrasts with set_dat_content as an alternative for targeted edits. Also describes the condition where exactly one match is required (without replace_all) and instructs the caller to add context or set replace_all if multiple matches exist.

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