Skip to main content
Glama
quinny1187

Obsidian MCP Server

by quinny1187

list_notes

Retrieve all notes from an Obsidian vault or specific folder to organize and access your knowledge base.

Instructions

List all notes in a vault or folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vault_pathYesPath to the Obsidian vault
folder_pathNoOptional folder path within vault

Implementation Reference

  • The handler function `handleListNotes` that validates the vault, lists markdown files, extracts metadata including titles from frontmatter or first H1 heading, and returns structured note list.
    export async function handleListNotes(
      vaultManager: VaultManager,
      vaultPath: string,
      folderPath?: string
    ) {
      await vaultManager.validateVault(vaultPath);
      
      const files = await vaultManager.listMarkdownFiles(vaultPath, folderPath);
      
      const notes = await Promise.all(
        files.map(async (file) => {
          try {
            const filePath = path.join(vaultPath, file);
            const stats = await fs.stat(filePath);
            
            // Try to extract title from frontmatter or first heading
            let title = path.basename(file, '.md');
            try {
              const content = await fs.readFile(filePath, 'utf-8');
              const parsed = matter(content);
              
              if (parsed.data.title) {
                title = parsed.data.title;
              } else {
                // Look for first # heading
                const match = parsed.content.match(/^#\s+(.+)$/m);
                if (match) {
                  title = match[1];
                }
              }
            } catch {
              // Ignore errors reading file content
            }
            
            return {
              path: file,
              title,
              modified: stats.mtime,
              size: stats.size,
            };
          } catch (error) {
            logger.warn(`Could not process file ${file}:`, error);
            return null;
          }
        })
      );
      
      return {
        vault: vaultPath,
        folder: folderPath,
        notes: notes.filter(n => n !== null),
      };
    }
  • Input schema for the `list_notes` tool, defining parameters vault_path (required) and optional folder_path.
    inputSchema: {
      type: 'object',
      properties: {
        vault_path: {
          type: 'string',
          description: 'Path to the Obsidian vault',
        },
        folder_path: {
          type: 'string',
          description: 'Optional folder path within vault',
        },
      },
      required: ['vault_path'],
    },
  • src/index.ts:104-121 (registration)
    Registration of the `list_notes` tool in the TOOLS array, including name, description, and input schema.
    {
      name: 'list_notes',
      description: 'List all notes in a vault or folder',
      inputSchema: {
        type: 'object',
        properties: {
          vault_path: {
            type: 'string',
            description: 'Path to the Obsidian vault',
          },
          folder_path: {
            type: 'string',
            description: 'Optional folder path within vault',
          },
        },
        required: ['vault_path'],
      },
    },
  • src/index.ts:203-208 (registration)
    Tool dispatch in the switch statement for CallToolRequestSchema, calling the handleListNotes handler with validated arguments.
    case 'list_notes':
      if (!args || typeof args !== 'object' || !('vault_path' in args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Missing vault_path');
      }
      result = await handleListNotes(vaultManager, args.vault_path as string, args.folder_path as string | undefined);
      break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action ('List all notes') but lacks behavioral details: no mention of pagination, sorting, format of returned notes, error conditions (e.g., invalid paths), or performance implications. For a read operation with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with zero waste. It is front-loaded with the core purpose and appropriately sized for a simple list operation. Every word earns its place without redundancy.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'List' returns (e.g., note names, metadata, paths), handle edge cases, or provide usage context. For a tool with 2 parameters and no structured output documentation, more detail is needed to guide effective use.

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 description coverage is 100%, so the schema already documents both parameters ('vault_path' and 'folder_path') with clear descriptions. The description adds no additional parameter semantics beyond what the schema provides, such as path format examples or interaction between parameters. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('List') and resource ('notes'), specifying the scope ('in a vault or folder'). It distinguishes from siblings like 'read_note' (single note) and 'search_vault' (filtered search), but doesn't explicitly differentiate from 'list_vaults' (different resource). The purpose is specific and unambiguous.

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 is provided. It doesn't mention when to prefer 'search_vault' for filtered results, or clarify the relationship with 'list_vaults' (which lists vaults, not notes). The description implies usage context but offers no explicit alternatives or exclusions.

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

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