Skip to main content
Glama
dot-RealityTest

obsidian-codex-mcp

get_note_links

Retrieves all wikilinks contained in a specified Obsidian note. Useful for understanding internal connections within your vault.

Instructions

Get all wikilinks from a note.

Args: path: Path to the note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP tool handler that wraps the ObsidianVaultClient.get_note_links method. Decorated with @mcp.tool() to register as an MCP tool.
    @mcp.tool()
    def get_note_links(path: str) -> list:
        """Get all wikilinks from a note.
        
        Args:
            path: Path to the note
        """
        try:
            client = get_vault_client()
            return client.get_note_links(path)
        except Exception as e:
            return [{"error": str(e)}]
  • server.py:257-258 (registration)
    The tool is registered as an MCP tool via the @mcp.tool() decorator on the function definition.
    @mcp.tool()
    def get_note_links(path: str) -> list:
  • Helper method on ObsidianVaultClient that extracts all [[wikilink]] targets from a note's content using regex, stripping header references (e.g., [[page#section]] -> 'page').
    def get_note_links(self, path: str) -> List[str]:
        """Extract all wikilink targets from a note."""
        note = self.get_note(path)
        if not note:
            return []
        
        content = note['content']
        link_pattern = re.compile(r'\\[\\[([^\\]|]+)(?:\\|[^\\]]*)?\\]\\]')
        
        links = []
        for match in link_pattern.findall(content):
            link_target = match.split('#')[0]  # Remove header references
            links.append(link_target)
        
        return links
Behavior2/5

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

No annotations are available, so the description carries full burden. It only states 'Get all wikilinks' without disclosing any behavioral traits like side effects, authentication needs, rate limits, or return characteristics. This is insufficient for a safe usage.

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 very concise, consisting of one sentence and an Args line. It front-loads the purpose. While efficient, it could benefit from slightly more structure (e.g., separating purpose from parameter description).

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?

Given the tool's simplicity (one param, no nested objects, no output schema), the description covers the core action but omits output format hints and usage context. For a complete picture, it should mention that the output is a list of wikilink targets or similar.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter 'path' has no schema description, but the description explains it as 'Path to the note', adding basic meaning. However, it does not elaborate on format, constraints, or examples, which would be valuable given 0% schema coverage.

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 all wikilinks from a note, using a specific verb 'get' and resource 'wikilinks from a note'. This distinguishes it from siblings like get_backlinks (which retrieves backlinks) and get_note (which retrieves note content).

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?

No guidance is provided on when to use this tool versus alternatives such as get_backlinks or get_note. The description lacks any context about prerequisites, exclusions, or recommended scenarios.

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