Skip to main content
Glama

find_duplicates

Identify near-identical pattern keys for consolidation by comparing token overlap and prefix matching. Suggests merges for formatting drift after bulk imports without performing changes.

Instructions

Detect near-identical pattern keys that should probably be merged.

    Compares every pattern against every other using token overlap and
    prefix matching. Flags candidate pairs above the threshold so you
    can apply alias_pattern() to consolidate them. Read-only — this
    tool suggests merges but never performs them.

    A common use case: after a bulk import_patterns() or import_claude_md(),
    call this to catch formatting drift (spacing, casing, punctuation).

    Args:
        threshold: Similarity cutoff, 0.0 to 1.0. Default 0.75. Lower
            thresholds (0.5) over-suggest; higher (0.9) under-suggest.
            Start at default and tune per your noise tolerance.

    Returns:
        Dict with keys: "duplicates" (list of {pattern_a, pattern_b,
        similarity}), "count" (int), "hint" pointing to alias_pattern
        as the next step.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: it's read-only (does not perform merges), uses token overlap and prefix matching for comparison, and flags candidate pairs above a threshold. However, it doesn't mention performance characteristics like execution time or resource usage, which could be relevant for large datasets.

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 well-structured and appropriately sized, with clear sections for purpose, usage guidelines, and parameter details. Every sentence adds value, though the 'Returns' section could be slightly more concise. It's front-loaded with the core purpose and usage context.

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 tool's complexity (pattern comparison algorithm), no annotations, and the presence of an output schema, the description provides complete context. It explains the tool's purpose, when to use it, behavioral characteristics, parameter semantics, and references the output structure. The output schema handles return value documentation, so the description doesn't need to duplicate that information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'threshold' parameter in detail: its range (0.0 to 1.0), default value (0.75), and practical guidance on tuning ('Lower thresholds (0.5) over-suggest; higher (0.9) under-suggest. Start at default and tune per your noise tolerance'). This compensates fully for the schema's lack of documentation.

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's purpose: 'Detect near-identical pattern keys that should probably be merged' with specific verbs (detect, compare, flag) and resources (pattern keys). It distinguishes from sibling tools by explicitly mentioning alias_pattern() as the tool for performing merges, making it distinct from other tools like consolidate or detect_chains.

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 provides explicit guidance on when to use this tool: 'after a bulk import_patterns() or import_claude_md(), call this to catch formatting drift (spacing, casing, punctuation).' It also specifies what it does not do ('Read-only — this tool suggests merges but never performs them') and points to alias_pattern as the alternative for performing merges.

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/yakuphanycl/instinct'

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