Skip to main content
Glama

patch_agent_prompt

Destructive

Performs string replacements in the start-node prompt (or proactiveMessage / customCSS). USE THIS instead of update_agent when the prompt is large and you only need to change a specific section. If get_agent returns empty instructions, this tool REFUSES a surgical patch — it will NOT replace the whole prompt with new_string. Workflow: get_agent → copy the exact span into old_string → new_string is the replacement. Only omit old_string when the field is truly empty and new_string is the FULL prompt. target=auto patches the start node instructions. Never writes vg_instructions (API rejects it). sync_mirrors defaults false.

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": {
      "agentId": "<agentId>",
      "new_string": "<new_string>"
    },
    "name": "patch_agent_prompt"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetNoField to patch. auto / vg_instructions / vg_systemPrompt all write nodes[0].instructions. customCSS patches widget CSS surgically.
agentIdYesThe agent ID whose prompt/text field to patch
new_stringYesReplacement text for the matched span. Use an empty string to delete the matched text.
old_stringNoText to find. Copy from get_agent. If the field is empty, this tool refuses a surgical patch — only omit old_string when installing a FULL prompt.
replace_allNoIf false (default), fails when old_string matches more than once. If true, replaces every occurrence.
sync_mirrorsNoWhen true, also apply the same replace to other writable prompt copies. Default false. vg_instructions / vg_systemPrompt are never written.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the refusal behavior on empty instructions, the prohibition on writing vg_instructions (API rejects it), and the sync_mirrors default. These are non-obvious safety constraints a mutation tool needs to surface.

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?

Front-loaded with the core action and the substitution guidance, then workflow details. Dense and slightly crowded by a long parenthetical, but every sentence carries actionable constraints.

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?

For a destructive, non-idempotent mutation with no output schema, the description covers the workflow, refusal path, write exclusions, and defaults. Nothing an agent needs to call it correctly is missing.

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%, so baseline is 3, but the description adds real meaning: copy the exact span into old_string, omit only when installing a FULL prompt, target=auto maps to the start node, and sync_mirrors default. Slightly overlapping with the schema, hence 4 not 5.

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?

States a specific verb and resource ('Performs string replacements in the start-node prompt'), lists the other patchable fields, and explicitly names the sibling tool it substitutes for (update_agent). An agent can distinguish it from update_agent without opening either schema.

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?

Explicit when-to-use ('USE THIS instead of update_agent when the prompt is large'), an ordered workflow, preconditions for omitting old_string, and the default/semantics of target=auto. Alternatives and exclusions are spelled out.

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