Skip to main content
Glama

Edit DAT content (surgical)

edit_dat_content
Destructive

Replace a substring within a Text or Table DAT's text in TouchDesigner. Requires exactly one match unless replace_all is set, enabling precise, 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. Because DAT text can become executable callbacks, this tool is hidden when TDMCP_RAW_PYTHON=off and the bridge also requires TDMCP_BRIDGE_ALLOW_EXEC=1 for writes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dat_pathYesAbsolute path to the Text or Table DAT to edit (e.g. '/project1/mytext1').
new_stringYesReplacement text. May be empty to delete the matched substring.
old_stringYesExact substring to find. Must match at least once. Empty strings are rejected.
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?

Adds rich behavioral context beyond annotations: exact-match error behavior, hidden tool setting when TDMCP_RAW_PYTHON=off, and bridge write requirement. No contradiction with readOnlyHint=false or destructiveHint=true.

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?

Three dense sentences, front-loaded with the core operation, then behavior, then alternative and safety context. No filler or redundancy.

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?

Complete for a destructive mutation tool: covers purpose, usage, error conditions, and security gating. Full schema coverage and no output schema mean no critical gaps remain.

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 descriptions cover all parameters (100% coverage). The description restates `replace_all` behavior but does not add new parameter-level meaning beyond what the schema already provides. Baseline 3 is appropriate.

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?

Clearly states it surgically replaces a substring inside a Text or Table DAT's `.text`, with a specific verb and resource. Distinguishes itself from `set_dat_content` by contrasting targeted edits vs. overwriting 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 names `set_dat_content` as the alternative for full overwrites and advises this tool for targeted edits. Also explains the exact-match requirement and when to set `replace_all`, giving clear usage context.

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