Skip to main content
Glama
dot-RealityTest

obsidian-codex-mcp

get_note

Retrieve a note from an Obsidian vault by providing its path relative to the vault root.

Instructions

Get a note by its path.

Args: path: Path to the note relative to vault root (e.g., "notes/my-note.md")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP tool handler for 'get_note'. Decorated with @mcp.tool(), receives a path parameter, gets the vault client, calls client.get_note(path), and returns the note dict or an error.
    @mcp.tool()
    def get_note(path: str) -> dict:
        """Get a note by its path.
        
        Args:
            path: Path to the note relative to vault root (e.g., "notes/my-note.md")
        """
        try:
            client = get_vault_client()
            note = client.get_note(path)
            
            if note is None:
                return {"error": f"Note not found: {path}"}
            
            return note
        except Exception as e:
            return {"error": str(e)}
  • ObsidianVaultClient.get_note() - core implementation. Resolves the vault-relative path, loads markdown content and frontmatter, normalizes tags, and returns a dict with path, content, metadata, title, tags, created, modified.
    def get_note(self, path: str) -> Optional[Dict[str, Any]]:
        """Get a note by path."""
        note_path = self._resolve_vault_path(path)
        if not note_path.exists() or not note_path.suffix.lower() == '.md':
            return None
        
        try:
            content, metadata = self._load_markdown(note_path)
            tags = sorted(set(self._normalize_tags(metadata.get('tags')) + self._extract_inline_tags(content)))
            
            return {
                'path': str(note_path.relative_to(self.vault_path)),
                'content': content,
                'metadata': metadata,
                'title': metadata.get('title', note_path.stem),
                'tags': tags,
                'created': metadata.get('created'),
                'modified': metadata.get('modified')
            }
        except Exception as e:
            raise RuntimeError(f"Error reading note {path}: {str(e)}")
  • server.py:87-88 (registration)
    Tool registration via the @mcp.tool() decorator on the get_note function. FastMCP registers this as an MCP tool named 'get_note'.
    @mcp.tool()
    def get_note(path: str) -> dict:
  • Type signature for get_note: takes a single 'path' parameter of type str, returns a dict. The docstring describes the expected input format.
    def get_note(path: str) -> dict:
        """Get a note by its path.
        
        Args:
            path: Path to the note relative to vault root (e.g., "notes/my-note.md")
        """
Behavior2/5

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

No annotations provided. Description lacks behavioral traits: whether note content or metadata is returned, error handling for non-existent notes, or any side effects. Significant gap.

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?

One sentence plus an Args section. Front-loaded, no wasted words, efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no output schema, the description explains the path but omits what the response contains (content vs metadata) and error behavior. Adequate but with gaps.

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 has zero description coverage. Description adds 'Path to the note relative to vault root' with an example, clarifying the parameter's meaning and format.

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?

Description states 'Get a note by its path' – a specific verb and resource. Distinguishes from siblings like create_note, delete_note, update_note.

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?

Provides example path and states it's relative to vault root. No explicit exclusions or comparisons to search_notes, but usage is clear for a retrieval tool.

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/dot-RealityTest/obsidian-codex-mcp'

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