Skip to main content
Glama

lsh_dedup

Detect and remove duplicate texts using SimHash, MinHash, and Hamming distance comparisons, with per-namespace dedup fences to cut redundant calls.

Instructions

    [Cost: $0.0005 USDC on Base & Solana] Sub-millisecond LSH deduplication oracle.

    Compute 64-bit SimHash fingerprints, estimate Jaccard similarity via MinHash,
    compare texts by Hamming distance, and maintain per-namespace dedup fences to
    eliminate redundant agent tool calls and duplicate web scraping payloads.

    Actions:
      simhash  — Compute 64-bit SimHash fingerprint(s).
                 Params: {"text": "..."} or {"texts": ["...", "..."]}
      compare  — Hamming distance between two fingerprints or texts.
                 Params: {"text_a": "...", "text_b": "..."} or
                         {"fingerprint_a": 12345, "fingerprint_b": 67890}
      minhash  — Jaccard similarity via MinHash signature comparison.
                 Params: {"text_a": "...", "text_b": "...", "threshold": 0.8}
      dedup    — Check text against seen-set fence; add if new.
                 Params: {"text": "...", "namespace": "my_swarm", "threshold": 3}
      stats    — Namespace statistics.
                 Params: {} or {"namespace": "my_swarm"}
      clear    — Reset namespace or all namespaces.
                 Params: {} or {"namespace": "my_swarm"}

    Args:
        action: Sub-action to execute (simhash/compare/minhash/dedup/stats/clear).
        params: Action-specific parameter dictionary.
        payment_signature: x402 Base USDC transaction hash (defaults to dev mock key).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNosimhash
paramsNo
payment_signatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It discloses cost, sub-millisecond performance, stateful seen-set fences, the clear action's reset semantics, and the payment_signature default. It could add return-value details, but it provides substantial behavioral context beyond the schema.

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 long but well-structured: a cost/performance summary, a purpose statement, and a bulleted action reference. Every section adds necessary operational detail, and the action list is easy to scan. No filler or redundant restatement of the schema.

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?

For a multi-action tool with no output schema and no annotations, the description covers actions, parameters, cost, and payment. It does not specify exact return formats for each action, but the outputs are largely inferable (e.g., Hamming distance, Jaccard similarity). Minor gaps around error handling and persistence prevent a perfect score.

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?

Schema description coverage is 0%, so the description fully compensates. It documents each action's expected params with concrete JSON examples, including text, texts, fingerprints, threshold, and namespace. It also explains payment_signature as an x402 Base USDC transaction hash with a dev mock default.

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 core function: LSH deduplication via SimHash, MinHash, Hamming distance, and per-namespace dedup fences. It enumerates six distinct actions, making the tool's scope and capabilities unambiguous. This distinguishes it from siblings like throttle_check or idempotency_vault by focusing on similarity-based deduplication.

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 explicitly names use cases: eliminating redundant agent tool calls and duplicate web scraping payloads. It does not mention alternatives or exclusions, but the intended context is clear enough for an agent to decide when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.