Skip to main content
Glama

list_canvas_files

Retrieve all canvas files from your Obsidian vault to organize and access visual content for knowledge management.

Instructions

List all canvas files in vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vaultYesVault name

Implementation Reference

  • The primary handler function that implements the tool logic by using glob to find all '*.canvas' files in the vault and returns their relative paths or an error.
    async listCanvasFiles(vaultPath: string): Promise<VaultOperationResult<string[]>> { try { const { glob } = await import('glob'); const pattern = path.join(vaultPath, '**/*.canvas'); const files = await glob(pattern, { ignore: '**/node_modules/**' }); const relativePaths = files.map(f => path.relative(vaultPath, f)); return { success: true, data: relativePaths }; } catch (error) { return { success: false, error: `Failed to list canvas files: ${error instanceof Error ? error.message : String(error)}` }; } }
  • The tool schema definition in the list of available tools, specifying the name, description, and input schema that requires a 'vault' parameter.
    { name: 'list_canvas_files', description: 'List all canvas files in vault', inputSchema: { type: 'object', properties: { vault: { type: 'string', description: 'Vault name' }, }, required: ['vault'], }, },
  • src/index.ts:733-743 (registration)
    The tool registration and dispatch logic in the main switch statement for handling CallToolRequestSchema, which retrieves the vault connector and calls the CanvasService handler.
    case 'list_canvas_files': { const connector = this.connectors.get(args?.vault as string); if (!connector || !connector.vaultPath) { throw new Error(`Vault "${args?.vault}" not found or not a local vault`); } const result = await this.canvasService.listCanvasFiles(connector.vaultPath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }

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/bazylhorsey/obsidian-mcp-server'

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