Skip to main content
Glama

read_note

Retrieve the complete content of a specific note from your Obsidian vault by providing its file path. Use this tool to access and review note details for reference or further processing.

Instructions

Read the full content of a note from the vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'read_note': validates the path, reads the note via vault.read_note, formats output with path, frontmatter (YAML), and body content, handles various errors.
    @mcp.tool(name="read_note", description="Read the full content of a note from the vault")
    async def read_note(path: str) -> str:
        """
        Read a note from the vault.
    
        Args:
            path: Relative path to the note (e.g., "Projects/MCP.md")
    
        Returns:
            Note content as markdown text with frontmatter
        """
        # Validate input
        if not path or not path.strip():
            return "Error: Path cannot be empty"
        if len(path) > 1000:
            return "Error: Path too long"
    
        context = _get_context()
    
        try:
            note = await context.vault.read_note(path)
    
            # Format response with metadata
            result = f"# {note.path}\n\n"
    
            if note.frontmatter:
                result += "## Frontmatter\n```yaml\n"
                result += yaml.dump(note.frontmatter, default_flow_style=False)
                result += "```\n\n"
    
            result += "## Content\n"
            result += note.body
    
            return result
    
        except FileNotFoundError:
            return f"Error: Note not found: {path}"
        except VaultSecurityError as e:
            return f"Error: Security violation: {e}"
        except Exception as e:
            logger.exception(f"Error reading note {path}")
            return f"Error reading note: {e}"
  • Core helper method in ObsidianVault that performs path validation/security checks, asynchronously reads the note file content, parses YAML frontmatter, and constructs/returns a Note dataclass instance.
    async def read_note(self, relative_path: str) -> Note:
        """
        Read a note from the vault.
    
        Args:
            relative_path: Path relative to vault root
    
        Returns:
            Note object with content and metadata
    
        Raises:
            VaultSecurityError: If path is invalid
            FileNotFoundError: If note doesn't exist
        """
        file_path = self._validate_path(relative_path)
    
        if not file_path.exists():
            raise FileNotFoundError(f"Note not found: {relative_path}")
    
        if not file_path.is_file():
            raise ValueError(f"Path is not a file: {relative_path}")
    
        async with aiofiles.open(file_path, encoding="utf-8") as f:
            content = await f.read()
        frontmatter, content = self._parse_frontmatter(content)
    
        return Note(path=relative_path, content=content, frontmatter=frontmatter)
  • MCP tool registration decorator specifying the tool name 'read_note' and its description.
    @mcp.tool(name="read_note", description="Read the full content of a note from the vault")
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Read') but doesn't cover important aspects like permissions needed, error handling, or what happens if the note doesn't exist. This is a significant gap for a tool that likely interacts with a data vault.

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 a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for a simple read operation, making it easy for an agent to parse quickly.

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 tool's low complexity (one parameter) and the presence of an output schema, the description is reasonably complete. It covers the basic action and resource, though it could benefit from more behavioral context, especially since no annotations are provided to fill in 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?

The description adds meaning by specifying that the 'path' parameter refers to a note in the vault, which clarifies beyond the schema's generic 'Path' title. With 0% schema description coverage and only one parameter, this compensates adequately, though it could provide more detail on path format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Read') and resource ('full content of a note from the vault'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_note' or 'search_notes', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'list_notes' or 'search_notes'. It lacks context about prerequisites or exclusions, leaving the agent to infer usage based on the tool name alone.

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/getglad/obsidian_mcp'

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