Skip to main content
Glama
sureshsankaran

Obsidian Tools MCP Server

get_backlinks

Discover all notes linking to a specific note in your Obsidian vault to understand connections and references.

Instructions

Find all notes that link to a specific note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the note to find backlinks for

Implementation Reference

  • The main handler function that scans all notes in the vault for wikilinks and markdown links pointing to the specified path and returns a JSON list of backlinking notes.
    async function handleGetBacklinks(args: { path: string }): Promise<string> {
      const noteName = path.basename(args.path, ".md");
      const allNotes = await getAllNotes();
      const backlinks: string[] = [];
    
      for (const notePath of allNotes) {
        if (notePath === args.path) continue;
    
        const fullPath = path.join(VAULT_PATH, notePath);
        const content = await fs.readFile(fullPath, "utf-8");
    
        // Check for wikilinks to this note
        const wikiLinkPattern = new RegExp(`\\[\\[${noteName}(\\|[^\\]]+)?\\]\\]`);
        // Check for markdown links
        const mdLinkPattern = new RegExp(`\\]\\(${args.path}\\)`);
    
        if (wikiLinkPattern.test(content) || mdLinkPattern.test(content)) {
          backlinks.push(notePath);
        }
      }
    
      return JSON.stringify(backlinks, null, 2);
    }
  • The tool schema definition including name, description, and input schema for validation and listing.
      name: "get_backlinks",
      description: "Find all notes that link to a specific note",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Path to the note to find backlinks for",
          },
        },
        required: ["path"],
      },
    },
  • src/index.ts:917-919 (registration)
    The dispatch case in the CallTool request handler that routes calls to the get_backlinks handler function.
    case "get_backlinks":
      result = await handleGetBacklinks(args as { path: string });
      break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool's purpose, it doesn't describe what the output looks like (e.g., list of note paths, metadata), whether it's paginated, if it requires specific permissions, or any rate limits. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 directly states the tool's purpose with zero wasted words. It's front-loaded and appropriately sized for a simple tool with one parameter, making it easy to parse quickly.

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 low complexity (one parameter, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on output format, behavioral traits, or usage context. For a tool that returns data, the absence of output schema means the description should ideally hint at what's returned, which it doesn't.

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?

Schema description coverage is 100%, with the single parameter 'path' clearly documented in the schema. The description doesn't add any additional meaning beyond what the schema provides (e.g., it doesn't explain path format or examples). Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 specific action ('Find all notes that link to') and resource ('a specific note'), distinguishing it from siblings like get_links (which likely finds outgoing links) or search_content/search_notes (which search content or metadata). It precisely communicates the tool's unique function in the note-linking ecosystem.

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

Usage Guidelines3/5

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

The description implies usage when you need to discover which notes reference a particular note, but it doesn't explicitly state when to use this tool versus alternatives like get_links or search_content. No guidance is provided on prerequisites, exclusions, or specific scenarios where this tool is preferred over others.

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/sureshsankaran/obsidian-tools-mcp'

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