Skip to main content
Glama
bazylhorsey
by bazylhorsey

list_periodic_notes

Retrieve periodic notes from your Obsidian vault by type and date range to organize and access time-based documentation efficiently.

Instructions

List periodic notes of a specific type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateNoEnd date (YYYY-MM-DD)
startDateNoStart date (YYYY-MM-DD)
typeYesNote type
vaultYesVault name

Implementation Reference

  • Core handler function that lists periodic notes by scanning the configured folder for .md files, parsing dates from filenames based on format, filtering by optional date range, sorting by date descending, and returning an array of PeriodicNoteInfo objects.
    async listPeriodicNotes(
      vaultPath: string,
      type: PeriodicNoteType,
      startDate?: Date,
      endDate?: Date
    ): Promise<VaultOperationResult<PeriodicNoteInfo[]>> {
      try {
        const config = this.settings[type];
        const folderPath = path.join(vaultPath, config.folder);
    
        // Check if folder exists
        try {
          await fs.access(folderPath);
        } catch {
          return { success: true, data: [] };
        }
    
        const { glob } = await import('glob');
        const pattern = path.join(folderPath, '**/*.md');
        const files = await glob(pattern);
    
        const notes: PeriodicNoteInfo[] = [];
    
        for (const file of files) {
          const relativePath = path.relative(vaultPath, file);
          const filename = path.basename(file, '.md');
    
          // Try to parse date from filename
          const date = this.parseDateFromFilename(filename, config.format);
          if (!date) continue;
    
          // Filter by date range if specified
          if (startDate && date < startDate) continue;
          if (endDate && date > endDate) continue;
    
          notes.push({
            type,
            date,
            path: relativePath,
            title: filename,
            exists: true,
          });
        }
    
        // Sort by date descending
        notes.sort((a, b) => b.date.getTime() - a.date.getTime());
    
        return { success: true, data: notes };
      } catch (error) {
        return {
          success: false,
          error: `Failed to list ${type} notes: ${error instanceof Error ? error.message : String(error)}`
        };
      }
    }
  • MCP server request handler for the list_periodic_notes tool. Validates vault connector, parses input arguments including type and date ranges, delegates to PeriodicNotesService.listPeriodicNotes, and formats the result as MCP content response.
    case 'list_periodic_notes': {
      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 type = args?.type as 'daily' | 'weekly' | 'monthly' | 'yearly';
      const startDate = args?.startDate ? new Date(args.startDate as string) : undefined;
      const endDate = args?.endDate ? new Date(args.endDate as string) : undefined;
      const result = await this.periodicNotesService.listPeriodicNotes(
        connector.vaultPath,
        type,
        startDate,
        endDate
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/index.ts:459-472 (registration)
    Tool registration in the ListTools handler, defining the name, description, and input schema for list_periodic_notes.
    {
      name: 'list_periodic_notes',
      description: 'List periodic notes of a specific type',
      inputSchema: {
        type: 'object',
        properties: {
          vault: { type: 'string', description: 'Vault name' },
          type: { type: 'string', enum: ['daily', 'weekly', 'monthly', 'yearly'], description: 'Note type' },
          startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
          endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
        },
        required: ['vault', 'type'],
      },
    },
  • Input schema definition for the list_periodic_notes tool, specifying required vault and type, optional date ranges.
    inputSchema: {
      type: 'object',
      properties: {
        vault: { type: 'string', description: 'Vault name' },
        type: { type: 'string', enum: ['daily', 'weekly', 'monthly', 'yearly'], description: 'Note type' },
        startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
        endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
      },
      required: ['vault', 'type'],
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose if this is a read-only operation, how results are returned (e.g., pagination, format), or any constraints like rate limits. 'List' implies a safe read, but details are missing for effective agent use.

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's front-loaded and appropriately sized for the tool's purpose, making it easy to parse without unnecessary elaboration.

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 return values, behavioral traits, or usage context, leaving gaps for a tool with 4 parameters and siblings like 'search_notes'. More detail is needed for adequate agent guidance.

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 fully documents parameters like 'startDate', 'endDate', 'type' with enum, and 'vault'. The description adds no extra meaning beyond implying filtering by 'type', aligning with the baseline score for high schema coverage.

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

Purpose3/5

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

The description 'List periodic notes of a specific type' clearly states the verb ('list') and resource ('periodic notes'), but it's vague about scope and lacks differentiation from sibling tools like 'get_periodic_note_info' or 'search_notes'. It doesn't specify if this lists all notes or filters by date range, which the schema implies.

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 is provided on when to use this tool versus alternatives like 'search_notes' or 'get_periodic_note_info'. The description doesn't mention prerequisites, exclusions, or context for selecting this tool over siblings, leaving usage unclear.

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