Skip to main content
Glama
yuchi-chang

obsidian-mcp

by yuchi-chang

Capture Obsidian screenshot

obsidian_dev_screenshot
Read-only

Capture a base64-encoded PNG screenshot of the active Obsidian window. Optionally specify a vault name to target a specific vault.

Instructions

Returns a base64-encoded PNG screenshot of the running Obsidian window.

Input Schema

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

Implementation Reference

  • The handler for 'obsidian_dev_screenshot' calls runText('dev:screenshot', { vault }), which executes the 'dev:screenshot' command via the Obsidian CLI.
    handler: async ({ vault }) => runText("dev:screenshot", { vault }),
  • src/tools.ts:788-796 (registration)
    The tool 'obsidian_dev_screenshot' is registered in the tools array with name, title, description, inputSchema, annotations, and handler.
    {
      name: "obsidian_dev_screenshot",
      title: "Capture Obsidian screenshot",
      description:
        "Returns a base64-encoded PNG screenshot of the running Obsidian window.",
      inputSchema: { ...VaultArg },
      annotations: { readOnlyHint: true, openWorldHint: true },
      handler: async ({ vault }) => runText("dev:screenshot", { vault }),
    },
  • Input schema uses VaultArg (optional vault name). Output is base64-encoded PNG screenshot text.
    inputSchema: { ...VaultArg },
  • runText wraps runObsidian, returning stdout/stderr as a 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 executes the 'obsidian' CLI with the given command (e.g., 'dev:screenshot') and returns the result.
    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") {
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint. Description adds no new behavioral context beyond what annotations provide, aligning with them.

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, 10 words, front-loaded with primary action. No redundant 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?

Given low complexity (1 optional param, no output schema), description completely covers what the tool does and returns. No missing details evident.

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 covers 100% of parameter descriptions. The only parameter 'vault' is fully described in schema; description adds no extra semantics beyond that.

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?

Description clearly states the tool returns a base64-encoded PNG screenshot, specifying verb and resource. It distinguishes from sibling tools such as obsidian_dev_console and obsidian_dev_errors.

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. Description is self-explanatory but lacks explicit context for selection.

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