Skip to main content
Glama
jagoff

obsidian-mcp-complete

by jagoff

obsidian_list_commands

Read-only

Retrieves all available commands from Obsidian's command palette using the local REST API. Provides programmatic inspection of plugin registered commands.

Instructions

List Obsidian command-palette commands through Local REST API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/tools.ts:1257-1266 (registration)
    Registration of the obsidian_list_commands tool via the local 'tool()' helper. Uses the Obsidian Local REST API to list command-palette commands.
    tool(
      "obsidian_list_commands",
      "List Obsidian command-palette commands through Local REST API.",
      {},
      async () => {
        if (!config.enableCommands) throw new Error("Set OBSIDIAN_ENABLE_COMMANDS=1 to expose command-palette tooling.");
        return obsidianRestRequest(config, { path: "/commands/" });
      },
      { readOnlyHint: true },
    );
  • Handler for obsidian_list_commands: checks OBSIDIAN_ENABLE_COMMANDS config, then proxies to obsidianRestRequest with path '/commands/'.
    async () => {
      if (!config.enableCommands) throw new Error("Set OBSIDIAN_ENABLE_COMMANDS=1 to expose command-palette tooling.");
      return obsidianRestRequest(config, { path: "/commands/" });
    },
  • Schema for obsidian_list_commands: no parameters (empty object). Tool description: 'List Obsidian command-palette commands through Local REST API.'
    "obsidian_list_commands",
    "List Obsidian command-palette commands through Local REST API.",
    {},
  • obsidianRestRequest helper function that makes HTTP requests to the Obsidian Local REST API. Used by the handler to call GET /commands/.
    export async function obsidianRestRequest(config: ObsidianMcpConfig, options: RestRequestOptions): Promise<{
      status: number;
      ok: boolean;
      contentType: string;
      body: unknown;
    }> {
      if (!config.restApiKey) throw new Error("OBSIDIAN_API_KEY is not configured");
      if (config.restInsecureTls) process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
      const url = new URL(options.path.replace(/^\/+/, ""), `${config.restUrl.replace(/\/+$/, "")}/`);
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 15000);
      try {
        const headers: Record<string, string> = {
          Authorization: `Bearer ${config.restApiKey}`,
        };
        let body: string | undefined;
        if (options.body !== undefined) {
          if (typeof options.body === "string") {
            body = options.body;
            headers["Content-Type"] = options.contentType ?? "text/markdown";
          } else {
            body = JSON.stringify(options.body);
            headers["Content-Type"] = options.contentType ?? "application/json";
          }
        }
        const response = await fetch(url, {
          method: options.method ?? "GET",
          headers,
          body,
          signal: controller.signal,
        });
        const contentType = response.headers.get("content-type") ?? "";
        const text = await response.text();
        let parsed: unknown = text;
        if (contentType.includes("application/json")) {
          try {
            parsed = JSON.parse(text);
          } catch {
            parsed = text;
          }
        }
        return { status: response.status, ok: response.ok, contentType, body: parsed };
      } finally {
        clearTimeout(timeout);
      }
    }
  • The 'enableCommands' config flag (OBSIDIAN_ENABLE_COMMANDS) that gates access to obsidian_list_commands.
    enableCommands: boolean;
Behavior3/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false, so the description's 'list' is consistent. No additional behavioral details are provided beyond the annotations, but none are needed for this simple read-only operation.

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, no wasted words. Clearly concise and front-loaded.

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?

Given the simplicity of the tool (no parameters, no output schema), the description is complete enough. It covers what the tool does without missing essential information.

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

Parameters4/5

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

No parameters exist, and schema coverage is 100%. With zero parameters, the description does not need to add parameter information, so baseline 4 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 it lists Obsidian command-palette commands, with a specific verb and resource. This distinguishes it from siblings like obsidian_list_files or obsidian_list_tags.

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 on when to use this tool versus alternatives like obsidian_execute_command or others. The description implies usage but does not provide explicit context.

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