Skip to main content
Glama

topos_compare_files

Read-onlyIdempotent

Compute AST tree-edit distance between two source files to detect code clones or assess refactoring impact.

Instructions

Compute the AST (tree-edit) distance between two source files on disk. Read-only; parses both files, never writes or scores. Use for clone detection or refactor impact; use topos_assess_* for a quality verdict. Returns a ComparisonResult (see topos_compare_code).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesBaseline file path.
targetYesComparison file path.
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, which the description reinforces by stating 'Read-only; parses both files, never writes or scores.' Additionally, the description adds behavioral details like computing AST distance and returning a ComparisonResult, which go beyond annotations.

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 three sentences, front-loaded with the core purpose, followed by safety and usage guidance. Every sentence adds value without redundancy or fluff.

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?

The description covers purpose, safety, usage, and output (returns ComparisonResult, referencing `topos_compare_code`). Given the tool's moderate complexity and the presence of rich annotations, the description is complete for an agent to understand and invoke the tool correctly.

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 input schema has 100% coverage with descriptions for both parameters ('Baseline file path.' and 'Comparison file path.'). The description does not add further semantics beyond what the schema provides, so a baseline score of 3 is appropriate.

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 computes AST (tree-edit) distance between two source files. It specifies the verb 'compute' and resource 'AST distance', and distinguishes itself from sibling tools like `topos_assess_*` by stating it is for clone detection or refactor impact, not quality verdicts.

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?

The description explicitly says when to use: for clone detection or refactor impact. It also provides a clear alternative: use `topos_assess_*` for a quality verdict. This gives direct guidance on tool selection.

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/Krv-Labs/topos'

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