Skip to main content
Glama

apply_changes

Apply multiple graph spec edits in a single atomic call, adding or removing nodes, edges, and state schemas at once.

Instructions

Apply several spec edits in one call instead of one add_node/add_edge/... call each.

Prefer this over separate calls whenever wiring more than one node/edge at once (e.g. adding a whole tool-calling loop) — it's the same edit, one round trip instead of several.

operations is a list, applied in order against one loaded spec and saved once at the end. Nothing is written if any operation is invalid (bad op name, missing required field, dangling reference) — the whole batch is atomic. Each entry is a dict with an "op" key plus that operation's normal arguments:

{"op": "add_node", "id": "tools", "config": {"function": "call_tools"}} {"op": "add_edge", "from_": "chatbot", "condition": "route", "paths": {"continue": "tools", "end": "END"}} {"op": "add_edge", "from_": "tools", "to": "chatbot"} {"op": "remove_node", "id": "..."} {"op": "remove_edge", "from_": "...", "to": "..."} {"op": "set_state_schema", "fields": [...]}

entry_point is set automatically (the first node added, or pass entry_point=true on a later add_node op) — don't add an edge from "START" yourself, even though rendered graph.py contains one; that edge is derived from entry_point, not wired as a spec edge.

Returns a compact summary (counts), like the other mutating tools — call get_spec if you need the full picture afterward.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationsYes
project_dirYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, this description carries the full behavioral burden. It discloses atomicity ('Nothing is written if any operation is invalid'), ordering ('applied in order'), persistence ('saved once at the end'), automatic entry_point derivation, and the compact summary return. This is a thorough behavioral contract for a mutating batch tool.

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?

The description is moderately long but every sentence carries instructional weight: usage guidance, atomicity, operation format, entry_point caveat, and return behavior. The front-loaded purpose and clean example block make it easy to scan, with no filler.

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?

Given the tool's complexity (multi-operation batching with atomic semantics) and an existing output schema, the description covers all necessary operational details: operation set, ordering, atomicity, entry_point handling, and post-call guidance. An agent can invoke it correctly and predict its side effects without needing additional information.

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 description coverage is 0%, but the description compensates richly for the `operations` parameter with a full format spec and concrete examples for add_node, add_edge, remove_node, remove_edge, and set_state_schema. However, `project_dir` is never explained beyond its name in the schema, leaving a small gap in an otherwise strong parameter narrative.

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 opens with 'Apply several spec edits in one call' and explicitly contrasts with individual add_node/add_edge calls, naming the sibling tools it replaces. This makes the batch-mutation purpose unmistakable and differentiates it from the single-edit siblings.

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?

It gives a clear when-to-use rule ('whenever wiring more than one node/edge at once') and mentions the alternative of separate calls. It also explains when not to fabricate a START edge, and routes to get_spec for full results, leaving no ambiguity about selection or follow-up.

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