Skip to main content
Glama
jgauffin

ts-language-mcp

by jgauffin

detect_duplication

Find exact structural duplicate code blocks by comparing AST fingerprints, ignoring identifier names and literal values. Works on a single file or across a whole project.

Instructions

Detect duplicate code blocks by comparing AST structure fingerprints. Matches are exact structural duplicates, ignoring identifier and literal values, so renamed copies are found but near-misses with an extra statement are not.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath to file (relative to project root). Omit for project-wide analysis.
minNodesNoMinimum AST node count for a block to be considered (default: 20)
minStatementsNoMinimum statements in a block (default: 3)
Behavior5/5

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

Even without annotations, the description exhaustively discloses behavioral traits: it detects duplicates by AST fingerprint, ignores identifiers/literals (finding renamed copies), and explicitly specifies that it does not catch near-misses with extra statements. This fully informs the agent of the tool's capabilities and limitations.

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 extremely concise—just two sentences—and front-loads the main action and method. Every sentence adds crucial information about what the tool does, how it works, and its limitations. No words are wasted.

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 moderate complexity of the tool (3 optional parameters, no output schema, no annotations), the description is remarkably complete. It explains the core behavior, matches, and exclusions, leaving no significant gaps for an agent to understand when and how to use it.

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?

With 100% schema description coverage, the baseline is 3. The description adds value by clarifying the matching behavior (ignoring identifiers/literals) which helps parameter understanding (e.g., what 'file' scope means). However, it does not elaborate on the parameter semantics beyond what the schema provides, so a 4 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 what the tool does ('Detect duplicate code blocks') and specifies the method ('comparing AST structure fingerprints'). It also distinguishes what matches are found (exact structural duplicates ignoring identifiers/literals) and what is not (near-misses with extra statement), leaving no ambiguity about its purpose.

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 guidance on when to use this tool for finding exact structural duplicates, and explicitly states that near-misses with extra statements are not found. However, it does not mention when to use alternatives from the sibling list (e.g., 'calculate_metrics' or 'get_references') which could provide complementary duplication analysis.

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/jgauffin/ts-language-mcp'

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