Skip to main content
Glama

docgraph_similar

Destructive

Find documents topically similar to a given document using TF-IDF term overlap, shared references, and tag overlap. Returns a similarity score and the signal components.

Instructions

Find documents topically similar to a given document using TF-IDF term overlap + shared references + tag overlap (engine=auto/tfidf — the default, always on, no flags). Returns 0 results for a topically unique document (a broad README or changelog commonly has no similar_to edges even when the index is fully built and the engine is working): 0 does NOT mean the engine is off, embeddings are disabled, or the index is broken. Neural similarity is an OPTIONAL add-on layered on top — only if embeddings were stored via docgraph_embeddings action=store (engine=neural) are neural scores added; embeddings being disabled never causes a TF-IDF 0-result. For explicit link tracking use docgraph_graph. Accepts document paths only — heading anchors (doc.md#heading) return empty. The score is a 0-to-1 weighted blend (TF-IDF cosine 50% + shared-reference Jaccard 30% + tag Jaccard 20%); it is NOT a percentage. Each result shows the three signal components that drove its score. No per-vocabulary-term breakdown is available — the engine does not retain individual term contributions, so you cannot identify which specific terms, phrases, or mentions made a score high OR low; any per-term explanation of the TF-IDF component is fabricated. Scores are corpus-relative; 0.4-0.5 can mean near-identical in a corpus with high shared vocabulary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentYesDocument name or path (document paths only; heading anchors return empty)
engineNoSimilarity engine: auto (default), tfidf, or neural. neural requires --enable-embeddings; returns an error if the server was not started with that flag. To check whether neural is available BEFORE querying, call docgraph_status and inspect the docgraph_embeddings field.
limitNoMax results (default 10)
projectNoWorkspace mode only: scope results to a single project by name (the directory name shown in docgraph_status). Omit to query all projects. No-op in single-store mode.
Behavior3/5

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

The description is very transparent about limitations (no per-term breakdown, scores are corpus-relative, 0 results meaning). However, annotations indicate destructiveHint=true, implying the tool might modify state, but the description suggests a purely read-only operation (find similar documents). This contradiction reduces the score.

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?

Description is long but efficiently packed with necessary details. Front-loaded with main purpose, then edge cases and caveats. Minor redundancy (e.g., repeated '0 does NOT mean'), but every sentence earns its place.

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 complexity (multiple engines, scoring formula, edge cases like 0 results), the description is thorough. Explains weighted blend, what results contain, and limitations. No output schema, but the description covers return format sufficiently.

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?

Schema coverage is 100% with descriptions, but the description adds significant value: explains engine defaults (auto/tfidf always on, no flags), document path restrictions, limit default, and project scope behavior. Exceeds baseline.

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?

Clearly states it finds topically similar documents using TF-IDF, shared references, and tag overlap. Distinguishes from sibling tools like docgraph_graph for explicit link tracking and mentions docgraph_embeddings for neural similarity. Specific verb and resource, no ambiguity.

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?

Explicitly tells when to use alternatives (e.g., docgraph_graph for explicit link tracking). Warns that heading anchors return empty, explains 0 results do not indicate engine failure, and advises checking docgraph_status for neural availability. Comprehensive guidance.

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/Detective-XH/DocGraph'

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