Skip to main content
Glama

Get complete prepared-operation diff

ast_get_operation_preview
Read-onlyIdempotent

Retrieve exact unified diffs retained for a prepared operation, optionally filtering to a single affected file by path. Use this to review planned changes before applying them, with secure prepare-to-apply mutation semantics.

Instructions

Retrieves exact unified diffs retained for a prepared operation, optionally one affected file at a time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOptional affected file path to retrieve only its diff.
operation_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
plan_hashYes
operation_idYes
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is well covered. The description adds the behavioral detail that diffs are retained (i.e., this isn't a live diff computation) and that it can optionally filter by file. No annotation contradiction. Reasonable but not rich behavioral context beyond what annotations give.

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?

Single sentence, front-loaded with the core purpose ('Retrieves exact unified diffs'), and efficiently conveys the optional file-filtering behavior. No wasted words. Could arguably add more context but stays tight.

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?

The tool has an output schema, so return-value documentation isn't needed. With good annotations (read-only, idempotent) and an output schema, the main gap is explaining the 'prepared operation' lifecycle - how an operation becomes prepared and whether this preview reflects the exact diff that ast_apply_operation will execute. Given the sibling apply tool, a brief flow hint would improve completeness.

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 50% - the file parameter has a description ('Optional affected file path to retrieve only its diff') but operation_id only has a UUID format with no prose description. The description references the file-filtering capability, reinforcing the file param, but doesn't add meaning to the required operation_id beyond its name. Baseline 3 is appropriate given partial coverage.

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

Purpose3/5

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

The description says 'Retrieves exact unified diffs retained for a prepared operation', which is a clear verb+resource statement. However, 'prepared operation' is a domain concept that isn't explained, and it doesn't clearly distinguish from sibling ast_apply_operation (which likely consumes these diffs). The word 'complete' and 'optional one file at a time' add some scope clarity.

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 description implies this is for inspecting diffs BEFORE applying an operation, given the 'prepared operation' wording and the existence of ast_apply_operation sibling. But there's no explicit statement of when to use this vs ast_apply_operation, and no mention of prerequisites (e.g., must a prepared operation exist first?). The guidance is implied through context rather than stated.

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