Skip to main content
Glama
jagoff

obsidian-mcp-complete

by jagoff

obsidian_open_in_ui

Open a note in the Obsidian UI by specifying its vault-relative path. Requires the OBSIDIAN_ENABLE_UI_OPEN environment variable set to 1.

Instructions

Open a note in the Obsidian UI via obsidian:// URI. Execution requires OBSIDIAN_ENABLE_UI_OPEN=1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultNoOptional configured vault name. Defaults to the server default vault.
pathYesVault-relative path. Absolute paths and traversal are rejected.
executeNo

Implementation Reference

  • The handler for obsidian_open_in_ui tool. It builds an obsidian://open URI for the given vault and note path. If execute=false it returns the URI without running it. If execute=true and OBSIDIAN_ENABLE_UI_OPEN is set, it calls `open` (macOS command) to open the URI in the Obsidian UI.
    tool(
      "obsidian_open_in_ui",
      "Open a note in the Obsidian UI via obsidian:// URI. Execution requires OBSIDIAN_ENABLE_UI_OPEN=1.",
      { vault: vaultArg, path: pathArg, execute: z.boolean().optional().default(false) },
      async (args) => {
        const vault = vaults.getVault(args.vault);
        const uri = `obsidian://open?vault=${encodeURIComponent(vault.name)}&file=${encodeURIComponent(vaults.notePath(args.path))}`;
        if (!args.execute) return { uri, executed: false };
        if (!config.enableUiOpen) throw new Error("Set OBSIDIAN_ENABLE_UI_OPEN=1 to allow this tool to open the Obsidian UI.");
        await execFileAsync("open", [uri], { timeout: 5000 });
        return { uri, executed: true };
      },
    );
  • Input schema for obsidian_open_in_ui: vault (optional), path (required vault-relative path), and execute (optional boolean, defaults to false).
    "obsidian_open_in_ui",
    "Open a note in the Obsidian UI via obsidian:// URI. Execution requires OBSIDIAN_ENABLE_UI_OPEN=1.",
    { vault: vaultArg, path: pathArg, execute: z.boolean().optional().default(false) },
  • src/tools.ts:1307-1319 (registration)
    The tool is registered inside the registerObsidianTools function (line 38) using the local `tool()` helper which wraps server.tool() on the McpServer.
    tool(
      "obsidian_open_in_ui",
      "Open a note in the Obsidian UI via obsidian:// URI. Execution requires OBSIDIAN_ENABLE_UI_OPEN=1.",
      { vault: vaultArg, path: pathArg, execute: z.boolean().optional().default(false) },
      async (args) => {
        const vault = vaults.getVault(args.vault);
        const uri = `obsidian://open?vault=${encodeURIComponent(vault.name)}&file=${encodeURIComponent(vaults.notePath(args.path))}`;
        if (!args.execute) return { uri, executed: false };
        if (!config.enableUiOpen) throw new Error("Set OBSIDIAN_ENABLE_UI_OPEN=1 to allow this tool to open the Obsidian UI.");
        await execFileAsync("open", [uri], { timeout: 5000 });
        return { uri, executed: true };
      },
    );
  • The enableUiOpen config flag (OBSIDIAN_ENABLE_UI_OPEN env var) that gates the execute behavior of obsidian_open_in_ui.
    enableUiOpen: boolean;
  • The related obsidian_open_uri tool which builds the same obsidian://open URI but never executes it (read-only hint).
      "obsidian_open_uri",
      "Build an obsidian://open URI for a note. This does not execute OS commands.",
      { vault: vaultArg, path: pathArg },
      (args) => {
        const vault = vaults.getVault(args.vault);
        const file = encodeURIComponent(vaults.notePath(args.path));
        return { uri: `obsidian://open?vault=${encodeURIComponent(vault.name)}&file=${file}` };
      },
      { readOnlyHint: true },
    );
Behavior3/5

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

Annotations provide basic hints (readOnlyHint=false, etc.). The description adds the execution requirement (env var) but doesn't detail side effects (e.g., changing active note). No contradiction with 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?

Two sentences, very concise, front-loads the action. Every sentence adds value without redundancy.

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 no output schema and sparse annotations, the description covers essential context: what it does, how (URI), and a critical prerequisite. Missing details on return behavior or errors, but acceptable for a one-way action.

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 67% (vault and path described, execute not). The description adds no additional parameter explanations beyond schema. It does not clarify the 'execute' parameter.

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 action ('Open a note in the Obsidian UI') and the mechanism ('via obsidian:// URI'). It distinguishes from siblings like obsidian_read_note or obsidian_create_note by specifying UI opening.

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?

The description provides a clear prerequisite (OBSIDIAN_ENABLE_UI_OPEN=1) but does not explicitly state when to use this tool versus alternatives. It implies UI opening use case, which is sufficient for most agents.

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

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