Skip to main content
Glama

ads_edit_piece

Destructive

Swap an EXACT piece of one piece's HTML for another. old must appear exactly once, unless replace_all.

Input Schema

NameRequiredDescriptionDefault
newYes
oldYes
nameYesThe piece's name, the one the person sees, e.g. "Instagram feed", "Story", "LinkedIn".
document_idYesThe document's id.
replace_allNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, so the mutation risk is covered by structured data. The description does add one genuine behavioral trait beyond that: the exact-once matching requirement and the replace_all escape hatch, which is a real failure mode an agent must anticipate. It stops short of saying what happens on a failed match or whether HTML is normalized.

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 short sentences, front-loaded with the operation and immediately followed by the critical constraint. No filler, no restatement of the tool name, and the conditional caveat is placed exactly where it is needed.

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 destructive, five-parameter edit tool with no output schema and no annotations covering error behavior, the definition says nothing about return value, no-match failure handling, or whether multiple edits can be batched. The core matching contract is present, but an agent would need to guess at the surrounding behavior.

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 coverage is only 40%, with `name` and `document_id` documented while `old`, `new`, and `replace_all` are bare. The description partially compensates by defining the matching contract for `old` and the role of `replace_all`, but `new` (literal replacement string? HTML fragment? escaping rules?) is left entirely undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: swapping an exact substring of a piece's HTML. That is clearly distinguishable from siblings like ads_write_piece or ads_read_piece once the agent knows what a 'piece' is, though the description never clarifies the piece/document relationship or names an alternative.

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?

There is no explicit when-to-use guidance and no mention of ads_write_piece as the alternative for full rewrites, nor ads_read_piece as the prerequisite for finding the exact `old` text. Usage must be inferred entirely from the verb 'swap' versus sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources