Skip to main content
Glama
sunub

Obsidian MCP Server

by sunub

Obsidian Content Getter

vault

Search and retrieve content from Markdown notes in an Obsidian vault. Use actions like search, read, or collect context to find notes by keyword or topic.

Instructions

Retrieves and searches the content of Markdown (.md, .mdx) documents stored in an Obsidian vault. Use this tool to find notes related to a specific topic or keyword and understand their core content.

When to use:

  • When you need to find a specific note by its title or a keyword to check its content.

  • When you want to synthesize and summarize information scattered across multiple notes.

  • When looking for answers to questions based on your saved records, such as "What was the project deadline?"

  • To discover connections by finding all notes that link to a specific note.

  • When you need to retrieve a list of unfinished tasks (- [ ]) from daily notes or meeting minutes.

  • Use "index_vault_to_vectordb" to manually trigger a full re-indexing of the vault for the vector database.

Returns the content of the most relevant document(s) in text format. It can also include metadata such as the document's title, tags, and creation date.

Requirements: The user's Obsidian Vault path must be correctly configured in an environment variable or a similar setting. For searches, use the exact filename or include core keywords for content-based queries.

IMPORTANT INSTRUCTION FOR AI: If the tool response includes a 'diagnostic_message' (usually found at the beginning of the text or in a tag), you MUST relay this information to the user exactly once. It contains essential advice on how to improve search quality by running a local setup script via 'npx @sunub/obsidian-mcp-server setup'. Do not ignore it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (default: 10 for search, unlimited for others)
queryNoNatural language query for filtering content paragraphs using the local reranker (optional for read action)
quietNoIf true, suppresses non-error output messages. Default is false.
scopeNoScope for collect_context. topic: collect docs relevant to topic, all: collect from the entire vault.topic
topicNoTopic to collect contextual memory for (collect_context action)
actionYesThe action to perform: search documents, read specific file, list all content, get stats, collect contextual memory packets, load stored memory, or trigger indexing
keywordNoKeyword to search for in documents (required for search action)
maxDocsNoMaximum number of documents to process for collect_context
filenameNoSpecific filename to read (required for read action)
memoryModeNoMemory output mode for collect_context. response_only: return packet only, vault_note: save to vault note only, both: return and save.response_only
memoryPathNoPath to a stored memory note for load_memory (default: memory/context_memory_snapshot.v1.md)
excerptLengthNoLength of content excerpt to include in search results (default: 500)
includeContentNoWhether to include document content in search results (default: true)
maxCharsPerDocNoMaximum number of characters extracted per document for collect_context
maxOutputCharsNoOptional hard cap for output size in characters. Helps control token cost in long responses.
compressionModeNoCompression strategy for tool output. summary: lightest TOC & document summary only (default), aggressive: smallest output, balanced: moderate size, none: keep as much original content as possible.summary
continuationTokenNoContinuation token to resume a previous collect_context batch operation
includeFrontmatterNoWhether to include frontmatter metadata in results (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.30
    • changedInput schema / properties / compressionMode / default
      Previous value: -"balanced"New value: +"summary"
    • changedInput schema / properties / compressionMode / description
      Previous value: -"Compression strategy for tool output. aggressive: smallest output, balanced: default, none: keep as much original content as possible."New value: +"Compression strategy for tool output. summary: lightest TOC & document summary only (default), aggressive: smallest output, balanced: moderate size, none: keep as much original content as possible."
    • changedInput schema / properties / compressionMode / enum
      Previous value: -[
      -  "aggressive",
      -  "balanced",
      -  "none"
      -]New value: +[
      +  "summary",
      +  "aggressive",
      +  "balanced",
      +  "none"
      +]
  2. Changed3 schema fields changedv0.3.29
    • changedInput schema / properties / action / description
      Previous value: -"The action to perform: search documents, read specific file, list all content, get stats, collect contextual memory packets, load stored memory, semantic search, or trigger indexing"New value: +"The action to perform: search documents, read specific file, list all content, get stats, collect contextual memory packets, load stored memory, or trigger indexing"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "search",
      -  "read",
      -  "list_all",
      -  "stats",
      -  "collect_context",
      -  "load_memory",
      -  "search_vault_by_semantic",
      -  "index_vault_to_vectordb"
      -]New value: +[
      +  "search",
      +  "read",
      +  "list_all",
      +  "stats",
      +  "collect_context",
      +  "load_memory",
      +  "index_vault_to_vectordb"
      +]
    • changedInput schema / properties / query / description
      Previous value: -"Natural language query for semantic search (required for search_vault_by_semantic action)"New value: +"Natural language query for filtering content paragraphs using the local reranker (optional for read action)"
  3. Changed12 schema fields changedv0.3.20
    • changedInput schema / properties / action / description
      Previous value: -"The action to perform: search documents, read specific file, list all content, or get stats"New value: +"The action to perform: search documents, read specific file, list all content, get stats, collect contextual memory packets, load stored memory, semantic search, or trigger indexing"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "search",
      -  "read",
      -  "list_all",
      -  "stats"
      -]New value: +[
      +  "search",
      +  "read",
      +  "list_all",
      +  "stats",
      +  "collect_context",
      +  "load_memory",
      +  "search_vault_by_semantic",
      +  "index_vault_to_vectordb"
      +]
    • addedInput schema / properties / compressionMode
      Added value: +{
      +  "default": "balanced",
      +  "description": "Compression strategy for tool output. aggressive: smallest output, balanced: default, none: keep as much original content as possible.",
      +  "enum": [
      +    "aggressive",
      +    "balanced",
      +    "none"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / continuationToken
      Added value: +{
      +  "description": "Continuation token to resume a previous collect_context batch operation",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / maxCharsPerDoc
      Added value: +{
      +  "default": 1800,
      +  "description": "Maximum number of characters extracted per document for collect_context",
      +  "maximum": 8000,
      +  "minimum": 200,
      +  "type": "integer"
      +}
    • addedInput schema / properties / maxDocs
      Added value: +{
      +  "default": 20,
      +  "description": "Maximum number of documents to process for collect_context",
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / maxOutputChars
      Added value: +{
      +  "description": "Optional hard cap for output size in characters. Helps control token cost in long responses.",
      +  "maximum": 12000,
      +  "minimum": 500,
      +  "type": "number"
      +}
    • addedInput schema / properties / memoryMode
      Added value: +{
      +  "default": "response_only",
      +  "description": "Memory output mode for collect_context. response_only: return packet only, vault_note: save to vault note only, both: return and save.",
      +  "enum": [
      +    "response_only",
      +    "vault_note",
      +    "both"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / memoryPath
      Added value: +{
      +  "description": "Path to a stored memory note for load_memory (default: memory/context_memory_snapshot.v1.md)",
      +  "type": "string"
      +}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Natural language query for semantic search (required for search_vault_by_semantic action)",
      +  "type": "string"
      +}
    • addedInput schema / properties / scope
      Added value: +{
      +  "default": "topic",
      +  "description": "Scope for collect_context. topic: collect docs relevant to topic, all: collect from the entire vault.",
      +  "enum": [
      +    "topic",
      +    "all"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / topic
      Added value: +{
      +  "description": "Topic to collect contextual memory for (collect_context action)",
      +  "minLength": 1,
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only provide openWorldHint. The description adds behavioral details: returns content and metadata, and includes crucial instruction about relaying diagnostic messages. This goes beyond annotations by disclosing expected output and a user interaction requirement.

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 with clear sections (purpose, when to use, return info, requirements, important instruction). It is front-loaded with the primary purpose. Though slightly verbose, every section adds value.

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?

Given the complexity (18 parameters, enums, no output schema), the description covers usage scenarios, return format, requirements, and a critical instruction. It provides sufficient context for an AI agent to use the tool effectively.

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%, so all parameters are described in the schema. The description adds contextual usage hints (e.g., 'use exact filename or core keywords for searches'), which enhances understanding beyond the schema 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?

The description clearly states the tool retrieves and searches Markdown documents in an Obsidian vault, specifying verb (retrieves, searches) and resource (Markdown documents). It implicitly distinguishes from sibling tools (which are for writing/properties) by focusing on reading/searching.

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 provides a detailed 'When to use' section with specific scenarios (find note, synthesize info, find answers, etc.) and mentions triggering re-indexing. However, it does not explicitly state when not to use the tool or compare with sibling tools.

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