Skip to main content
Glama
bazylhorsey
by bazylhorsey

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) }],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'List' implies a read-only operation, the description doesn't address important behavioral aspects like whether this returns all files at once or uses pagination, what format the results are in, whether there are rate limits, or what happens if the vault doesn't exist. For a tool with zero annotation coverage, this is insufficient behavioral context.

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?

The description is extremely concise at just 5 words, front-loading the essential information with zero wasted words. Every word earns its place: 'List' (action), 'all' (scope), 'canvas files' (resource), 'in vault' (context). There's no unnecessary elaboration or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's no output schema and no annotations, the description should provide more complete context for a listing operation. It doesn't indicate what information is returned about each canvas file, whether there are any filters or sorting options, or what happens with empty results. For a tool that presumably returns multiple items, the description is too minimal to be considered complete.

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?

The input schema has 100% description coverage, with the single parameter 'vault' clearly documented as 'Vault name'. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('canvas files in vault'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_folders', 'list_templates', or 'list_tags', which all perform similar listing operations on different resources. The description is specific about what's being listed but lacks sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'search_notes', 'dataview_query', and 'get_canvas' available, there's no indication of when listing all canvas files is preferable to searching or retrieving specific ones. The description simply states what the tool does without any contextual usage information.

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

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