Skip to main content
Glama
yuchi-chang

obsidian-mcp

by yuchi-chang

Disable a plugin

obsidian_disable_plugin
Idempotent

Disable a community plugin in an Obsidian vault by its ID for programmatic plugin management.

Instructions

Disables a community plugin by id.

Input Schema

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

Implementation Reference

  • Handler function for obsidian_disable_plugin — calls runText('plugin:disable', ...) which executes the Obsidian CLI 'plugin:disable' command with vault and plugin id.
    handler: async ({ vault, id }) =>
      runText("plugin:disable", { vault, params: { id } }),
  • Input schema for obsidian_disable_plugin — accepts 'vault' (optional string) and 'id' (required string) for the plugin identifier.
    inputSchema: {
      ...VaultArg,
      id: z.string().min(1),
    },
  • src/tools.ts:728-739 (registration)
    Tool definition registration for obsidian_disable_plugin in the tools array. It has name 'obsidian_disable_plugin', title 'Disable a plugin', description, inputSchema, annotations (readOnlyHint: false, idempotentHint: true), and a handler. No confirm prompt (unlike enable_plugin).
    {
      name: "obsidian_disable_plugin",
      title: "Disable a plugin",
      description: "Disables a community plugin by id.",
      inputSchema: {
        ...VaultArg,
        id: z.string().min(1),
      },
      annotations: { readOnlyHint: false, idempotentHint: true },
      handler: async ({ vault, id }) =>
        runText("plugin:disable", { vault, params: { id } }),
    },
  • The runText helper function that executes Obsidian CLI commands via runObsidian and returns text results. Used by the plugin:disable handler.
    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);
      }
    }
  • The runObsidian function that builds and executes the CLI command. It constructs the command-line arguments, invokes the 'obsidian' binary (or OBSIDIAN_CLI env var) and returns stdout/stderr.
    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,
        );
      }
    }
Behavior3/5

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

Annotations already indicate idempotentHint=true and readOnlyHint=false, so the description's simple 'Disables' is consistent but adds no extra behavioral context beyond the schema and 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?

Single sentence, 5 words, no redundancy. Every word serves a purpose.

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?

For a simple tool with one required parameter and no output schema, the description is functionally adequate but omits details like error handling or id format. Could be more helpful.

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

Parameters2/5

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

Schema coverage is 50%: 'vault' has a description, but 'id' lacks schema description. The description mentions 'by id' but doesn't clarify what constitutes a valid id or where to find it, providing only minimal compensation.

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 ('Disables') and resource ('community plugin by id'), clearly distinguishing it from siblings like obsidian_enable_plugin and obsidian_list_plugins.

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 (e.g., obsidian_uninstall_plugin is not present, but no context about prerequisites or when not to disable given).

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