Skip to main content
Glama
yuchi-chang

obsidian-mcp

by yuchi-chang

List unresolved links

obsidian_list_unresolved
Read-only

Identify wikilinks linking to missing notes in your Obsidian vault. This tool scans for broken links and lists unresolved targets to help maintain note integrity.

Instructions

Finds wikilinks that point to non-existent notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultNoVault name to target. Optional — defaults to the most recently focused vault.

Implementation Reference

  • Input schema for the tool — accepts optional 'vault' argument to target a specific vault.
    const VaultArg = {
      vault: z
        .string()
        .optional()
        .describe(
          "Vault name to target. Optional — defaults to the most recently focused vault.",
        ),
    };
  • src/tools.ts:631-638 (registration)
    Registration of the 'obsidian_list_unresolved' tool with name, title, description, input schema, annotations, and handler.
    {
      name: "obsidian_list_unresolved",
      title: "List unresolved links",
      description: "Finds wikilinks that point to non-existent notes.",
      inputSchema: { ...VaultArg },
      annotations: { readOnlyHint: true, openWorldHint: false },
      handler: async ({ vault }) => runJson("unresolved", { vault }),
    },
  • Handler that calls runJson('unresolved', {vault}) to execute the 'unresolved' command via the Obsidian CLI.
    handler: async ({ vault }) => runJson("unresolved", { vault }),
  • Helper function runJson that invokes runObsidian with the given command and returns structured JSON output.
    async function runJson(
      command: string,
      opts: Parameters<typeof runObsidian>[1] = {},
    ): Promise<McpToolResult> {
      try {
        const result = await runObsidian(command, { ...opts, format: opts.format ?? "json" });
        const parsed = parseJsonOrText(result.stdout);
        const text =
          typeof parsed === "string"
            ? parsed
            : JSON.stringify(parsed, null, 2);
        return textResult(text || "(no output)", parsed);
      } catch (err) {
        return errorResult(err);
      }
    }
  • Core exec helper runObsidian that builds and shells out to the 'obsidian' CLI binary with the given command.
    export async function runObsidian(
      command: string,
      opts: RunOptions = {},
    ): Promise<RunResult> {
      const bin = process.env.OBSIDIAN_CLI ?? "obsidian";
      const args = buildArgs(command, opts);
      const cmdline = [bin, ...args].map(shellQuote).join(" ");
    
      try {
        const { stdout, stderr } = await exec(cmdline, {
          maxBuffer: 64 * 1024 * 1024,
          windowsHide: true,
        });
        return { stdout, stderr, exitCode: 0, command: cmdline };
      } catch (err: unknown) {
        const e = err as NodeJS.ErrnoException & {
          stdout?: string;
          stderr?: string;
          code?: number | string;
        };
        const result: RunResult = {
          stdout: e.stdout ?? "",
          stderr: e.stderr ?? e.message ?? "",
          exitCode: typeof e.code === "number" ? e.code : 1,
          command: cmdline,
        };
        if (e.code === "ENOENT") {
          throw new ObsidianCliError(
            `Obsidian CLI binary not found ('${bin}'). ` +
              `Make sure Obsidian is running and the CLI is registered ` +
              `(Settings → General → Command line interface → Register CLI). ` +
              `Override with the OBSIDIAN_CLI env var if the binary lives elsewhere.`,
            result,
          );
        }
        throw new ObsidianCliError(
          `obsidian CLI exited with code ${result.exitCode}: ${result.stderr.trim() || result.stdout.trim()}`,
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the description adds behavioral context by specifying what the tool finds (unresolved wikilinks). It does not contradict annotations.

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, front-loaded sentence with no unnecessary words, earning its place efficiently.

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?

For a simple read-only list tool with one optional parameter and no output schema, the description adequately conveys the tool's purpose without missing critical details.

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 input schema already describes the single 'vault' parameter with high coverage (100%). The tool description adds no further parameter details, so the baseline 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 uses a specific verb 'Finds' and clearly defines the resource 'wikilinks that point to non-existent notes.' This distinguishes it from siblings like obsidian_list_orphans or obsidian_get_links.

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 for identifying broken wikilinks but provides no explicit guidance on when to use versus alternatives like obsidian_get_links or obsidian_list_orphans.

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/yuchi-chang/obsidian-mcp'

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