Skip to main content
Glama
maxkuminov

Obsidian MCP (pgvector + Ollama, self-hosted)

by maxkuminov

find_related

Find semantically related notes by comparing averaged chunk embeddings via pgvector, independent of link graph. Ideal for sparsely linked notes or thematic exploration.

Instructions

Semantically similar notes based on the source note's chunk embeddings, averaged then queried via pgvector.

Independent of the link graph — useful when the source is sparsely linked or when looking for thematic neighbors. For link-based exploration use get_neighborhood. For arbitrary topic queries use semantic_search.

Carries semantic_search's per-row markers and its header counts: stale: true means that neighbour changed after it was embedded, so it was ranked against its previous content and its preview is withheld — read_note returns the current text. embedding_truncated: true means only that note's head was embedded, so a match against it says nothing about its tail.

One marker is about the source rather than a neighbour. If the note you asked about has itself changed since it was embedded, the result says so once, at the top — and it says so on the empty result too. The query vector is the average of the source's stored chunk vectors, so a stale source means every neighbour answers a question about content that note no longer has, and "no related notes" from a stale source means "nothing is near what this note used to say", not "this note has no neighbours". The next embed pass repairs it. A source with no vectors at all is a different message ("has not been embedded yet") with a different fix.

The bound on the staleness signal: it reports what the index has committed, so an edit the indexer has not yet scanned is not marked.

Args: path: Vault-relative path to the source note. limit: Maximum results (default 10, hard cap 50).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.2
    • addedInput schema / additionalProperties
      Added value: +false
  2. Addedv0.7.0
  3. Removedv0.5.4
  4. First observed

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden. It fully discloses how the query works, what staleness markers mean, how a stale source invalidates all results, and the bound on the staleness signal. No contradictions with annotations (absent).

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?

Despite being long, the description is structured into clear sections: core purpose, usage guidance, marker semantics, source-specific behavior, and a bound on staleness. Every sentence adds value, and the most important information (purpose and alternatives) is front-loaded.

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?

An output schema exists, so return-value documentation is handled. The description covers invocation, edge cases (source not embedded, stale source), and result interpretation (markers). For a 2-parameter tool, this is complete and even anticipates user confusion.

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 must explain both parameters. It does: path is 'Vault-relative path to the source note', limit is 'Maximum results (default 10, hard cap 50)'. This fully compensates for the schema's lack of descriptions.

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?

States the specific mechanism (chunk embeddings averaged and queried via pgvector) and the resource (semantically similar notes). It explicitly distinguishes itself from get_neighborhood (link-based) and semantic_search (topic queries), making its role unambiguous.

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?

Clearly states when to use this (sparsely linked notes, thematic neighbors) and names the alternatives for different scenarios. Also includes practical caveats about staleness and when results are meaningful, which guides correct invocation.

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