Skip to main content
Glama

list_canvases

Retrieve all canvas files from your Obsidian vault to organize and access visual content efficiently.

Instructions

List all canvas files in the vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the list_canvases tool. It lists canvas files from the vault using the listCanvasFiles helper function.
    async () => {
      try {
        const files = await listCanvasFiles(vaultPath);
    
        if (files.length === 0) {
          return { content: [{ type: "text" as const, text: "No canvas files found in the vault." }] };
        }
    
        const formatted = files.map((f, i) => `${i + 1}. ${f}`).join("\n");
        return {
          content: [{ type: "text" as const, text: `Found ${files.length} canvas file(s):\n\n${formatted}` }],
        };
      } catch (err) {
        console.error("Failed to list canvas files:", err);
        return errorResult(`Error listing canvas files: ${err instanceof Error ? err.message : String(err)}`);
      }
    },
  • Registration of the list_canvases tool within the registerCanvasTools function.
    server.registerTool(
      "list_canvases",
      {
        description: "List all canvas files in the vault",
        inputSchema: {},
      },

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

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