Skip to main content
Glama

Edit a saved script

tool_edit
Destructive

Modify a saved print script by replacing its code, using find-and-replace on a snippet, or updating its description, parameters, or name.

Instructions

Change a saved script: replace its code, or find/replace a piece of it, or change its description, params or name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "tool_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoWhole new body
findNoExact text to replace once (alternative to code)
nameYes
paramsNo
replaceNo
new_nameNo
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the description would need to add real context such as irreversibility of overwriting code, exact-match/failure behavior of find/replace, or whether only one of code/find may be supplied. It says only that the script is 'changed', which is essentially the annotation's message restated. The most consequential risk, a full code body being replaced and the old one lost, is not called out.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with the resource first and the modes enumerated after; no filler. The parallel 'or... or... or' list is dense but readable and every clause maps to real parameters. Slightly list-like rather than explanatory.

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 7-parameter destructive mutation with no output schema, the description covers the shape of the operation but omits error behavior (find not matching, multiple matches), the constraint that code and find/replace are alternatives, and what happens to unmentioned fields. Adequate to attempt a call, insufficient to call it safely in edge cases.

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 only 29% across 7 parameters, so the description carries extra burden; it does mention code, find/replace, description, params and name, implicitly covering new_name as well. However, it does not explain the mutual exclusivity of code vs. find/replace, that find matches exactly once, or what new_name does versus name. Meaning added is broad but shallow.

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?

The description names a specific verb and resource ('Change a saved script') and enumerates the three edit modes: full code replacement, find/replace, and metadata changes (description, params, name). It clearly distinguishes an edit operation from siblings like tool_write or tool_remove. It stops short of naming those siblings explicitly to route the agent.

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

Usage Guidelines3/5

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

The enumerated modes imply when each is appropriate (full rewrite vs. targeted patch vs. metadata tweak), but the description never states the selection rule explicitly, nor when to use this versus tool_write for creating a script. The critical detail that 'find' is an alternative to 'code' lives only in the schema, not the description.

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