Skip to main content
Glama
gclluch
by gclluch

diff_ast

Compare two Python files structurally to reveal added, removed, or modified functions, classes, methods, module variables, imports, and all. Performs a signature-level diff, not a text diff.

Instructions

Structural diff between two Python files: added, removed and modified functions, classes, methods, module variables, imports and __all__. Signature-level, not text-level.

Args: old_path: Path to the original file. new_path: Path to the updated file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
new_pathYes
old_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It discloses that the diff is structural and signature-level, and what elements are considered. However, it does not mention any assumptions, limitations, or side effects (e.g., whether files must be syntactically valid, or whether it only reads files). This leaves some gaps but covers the primary behavioral traits of the 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 concise and well-structured: a one-sentence summary of functionality followed by a clear Args list. Every sentence adds value, and there is no repetition of schema fields beyond the necessary parameter explanations.

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?

The tool logically requires two file paths as inputs, and the description covers these sufficiently. Given an output schema exists, the return value structure is presumably documented elsewhere. The description could mention any prerequisites (e.g., valid Python files) but is otherwise complete for a diff tool.

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?

The schema provides only titles ('Old Path', 'New Path') with no descriptions, so the description's Args section adds meaning by clarifying 'Path to the original file' and 'Path to the updated file'. This helps establish parameter order and intent, though the addition is minimal compared to what could be said about path handling (e.g., existence, format).

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 clearly states the tool performs a structural diff between two Python files, enumerating specific elements (functions, classes, methods, module variables, imports, `__all__`). It distinguishes itself from sibling tools by focusing on comparison rather than listing or analysis, and clarifies it is signature-level rather than text-level.

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 a clear context for use: comparing two Python files structurally to see added, removed, and modified components. It implies when to use this tool (when a semantic diff is needed) but does not explicitly name alternatives or exclusion criteria. The 'signature-level, not text-level' note provides a key guideline for choosing this over textual diff tools.

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/gclluch/py-ast-mcp'

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