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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/canvas.ts:18-34 (handler)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)}`); } }, - src/tools/canvas.ts:12-17 (registration)Registration of the list_canvases tool within the registerCanvasTools function.
server.registerTool( "list_canvases", { description: "List all canvas files in the vault", inputSchema: {}, },