Skip to main content
Glama
yuchi-chang

obsidian-mcp

by yuchi-chang

Show CLI help

obsidian_help
Read-only

Displays the raw Obsidian CLI help output to diagnose unexpected command behavior. Optionally includes hidden commands with --all.

Instructions

Shows the underlying obsidian help output — useful when a command behaves unexpectedly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoPass --all to include hidden commands.

Implementation Reference

  • The handler function for the obsidian_help tool. It calls runText('help', ...) with optional --all flag passed via flags array.
    {
      name: "obsidian_help",
      title: "Show CLI help",
      description:
        "Shows the underlying `obsidian help` output — useful when a command behaves unexpectedly.",
      inputSchema: {
        all: z.boolean().optional().describe("Pass --all to include hidden commands."),
      },
      annotations: { readOnlyHint: true, openWorldHint: false },
      handler: async ({ all }) =>
        runText("help", { flags: all ? ["--all"] : [] }),
    },
  • Input schema for obsidian_help: optional boolean 'all' parameter to include hidden commands.
    inputSchema: {
      all: z.boolean().optional().describe("Pass --all to include hidden commands."),
    },
  • runText helper function that wraps runObsidian and formats stdout/stderr into an MCP text result.
    async function runText(
      command: string,
      opts: Parameters<typeof runObsidian>[1] = {},
    ): Promise<McpToolResult> {
      try {
        const result = await runObsidian(command, opts);
        const text = result.stdout.trim() || result.stderr.trim() || "(no output)";
        return textResult(text);
      } catch (err) {
        return errorResult(err);
      }
    }
  • runObsidian function that executes the 'obsidian' CLI binary with the built args. The actual execution of `obsidian help ...`.
    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()}`,
          result,
        );
  • src/tools.ts:814-835 (registration)
    The tool definition object registered in the tools array with name 'obsidian_help', along with 'obsidian_version' in the meta section.
      // ---------- meta ----------
      {
        name: "obsidian_version",
        title: "Get Obsidian CLI version",
        description: "Returns the version of the Obsidian CLI binary in use.",
        inputSchema: {},
        annotations: { readOnlyHint: true, openWorldHint: false },
        handler: async () => runText("version"),
      },
      {
        name: "obsidian_help",
        title: "Show CLI help",
        description:
          "Shows the underlying `obsidian help` output — useful when a command behaves unexpectedly.",
        inputSchema: {
          all: z.boolean().optional().describe("Pass --all to include hidden commands."),
        },
        annotations: { readOnlyHint: true, openWorldHint: false },
        handler: async ({ all }) =>
          runText("help", { flags: all ? ["--all"] : [] }),
      },
    ];
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description's behavioral contribution is minimal. It adds that output is from 'obsidian help', which is expected. No contradiction.

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?

Single sentence, front-loads purpose and usage context. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple help tool with one optional parameter and no output schema, the description is complete enough to inform agent behavior.

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?

Only one parameter ('all') with full schema coverage. Description does not add meaning beyond the schema's boolean description. Baseline 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 explicitly states it shows 'obsidian help' output, with a clear verb ('shows') and resource. It distinguishes from sibling tools which are all about notes, plugins, etc.

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?

Says 'useful when a command behaves unexpectedly', providing clear context for use. No explicit exclusions or alternatives, but siblings don't offer help, so it's sufficient.

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