Skip to main content
Glama

Apply a prepared structural operation

ast_apply_operation
DestructiveIdempotent

Applies a reviewed, plan-hash-verified operation to a TypeScript workspace after confirming the complete project fingerprint. Conflicts block writes, and retries are idempotent, ensuring only the approved changes are executed safely.

Instructions

Applies exactly the reviewed plan after verifying its plan hash and the complete TypeScript workspace fingerprint. Conflicts abort before writes; retries after success are idempotent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_hashYesPlan hash returned by the same prepare operation.
operation_idYesIdentifier returned by a prepare operation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
statusYes
applied_atYes
operation_idYes
affected_filesYes
idempotent_replayYes
Behavior4/5

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

Annotations declare destructiveHint=true and idempotentHint=true, which is consistent with the description. The description adds beyond annotations by disclosing that conflicts abort before writes, that it verifies the plan hash and workspace fingerprint, and that retries after success are idempotent. There is a small output schema available. This provides solid behavioral context matching the destructive and idempotent hints.

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?

The description is one tight sentence covering purpose, safety verification, conflict behavior, and idempotency. No wasted words. Could arguably be two sentences for readability, but it's efficient and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive write tool with 2 parameters, 100% schema coverage and an output schema, the description covers the key operational concerns: verifying the plan before applying, conflict abort behavior, and idempotent retries. Given the annotations already disclose destructive/idempotent traits and the schema documents parameters, this is reasonably complete. It could mention what the output contains or preconditions like requiring a prepare step to have been executed.

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 100% with both parameters described (plan_hash as 'returned by the same prepare operation', operation_id as 'Identifier returned by a prepare operation'). The description reinforces the relationship between the parameters and the prepare step but adds no format or validation details beyond the schema. Baseline of 3 is appropriate since schema does the heavy lifting.

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 states the verb 'Applies' with a clear resource ('the reviewed plan') and specifies the exact operation: applying a prepared structural operation. It distinguishes from siblings by framing itself as the application step after a prepare step, but it doesn't explicitly name a sibling alternative (like ast_get_operation_preview for previewing), so sibling differentiation is implicit rather than explicit.

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

Usage Guidelines4/5

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

The description gives clear when-to-use context: you apply 'exactly the reviewed plan' after verifying it, implying this should follow a prepare/preview flow (siblings include ast_get_operation_preview). It notes conflicts abort before writes, giving conflict-handling behavior. However, it doesn't explicitly say 'don't use this before reviewing' or name alternatives for when not to use it.

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/yailPeralta/ast-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server