Skip to main content
Glama
bazylhorsey
by bazylhorsey

create_yearly_note

Generate a yearly note in your Obsidian vault for organizing annual content, planning, and reflections using customizable templates.

Instructions

Create a yearly note for a specific year

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in the year (YYYY-MM-DD), defaults to this year
variablesNoAdditional template variables
vaultYesVault name

Implementation Reference

  • Core handler function that implements the logic for creating periodic notes, including yearly notes (when type='yearly'). Handles path generation, template rendering or default content, file creation.
    async createPeriodicNote(
      vaultPath: string,
      type: PeriodicNoteType,
      date?: Date,
      variables?: Record<string, any>
    ): Promise<VaultOperationResult<string>> {
      try {
        const noteDate = date || new Date();
        const config = this.settings[type];
    
        if (!config.enabled) {
          return { success: false, error: `${type} notes are not enabled` };
        }
    
        // Generate note path
        const notePath = this.getPeriodicNotePath(type, noteDate);
        const fullPath = path.join(vaultPath, notePath);
    
        // Check if note already exists
        try {
          await fs.access(fullPath);
          return { success: true, data: notePath }; // Already exists
        } catch {
          // Note doesn't exist, continue to create
        }
    
        // Ensure directory exists
        await fs.mkdir(path.dirname(fullPath), { recursive: true });
    
        let content: string;
    
        // Use template if specified
        if (config.templatePath) {
          const renderResult = await this.templateService.renderTemplate(
            vaultPath,
            config.templatePath,
            {
              targetPath: notePath,
              variables: {
                ...this.getPeriodicNoteVariables(type, noteDate),
                ...variables,
              },
            }
          );
    
          if (!renderResult.success || !renderResult.data) {
            return { success: false, error: renderResult.error };
          }
    
          content = renderResult.data.content;
        } else {
          // Generate default content
          content = this.generateDefaultContent(type, noteDate);
        }
    
        // Write file
        await fs.writeFile(fullPath, content, 'utf-8');
    
        return { success: true, data: notePath };
      } catch (error) {
        return {
          success: false,
          error: `Failed to create ${type} note: ${error instanceof Error ? error.message : String(error)}`
        };
      }
    }
  • Tool handler dispatch in the main server switch statement that extracts parameters and delegates to PeriodicNotesService.createPeriodicNote with type 'yearly'.
    case 'create_yearly_note': {
      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 date = args?.date ? new Date(args.date as string) : undefined;
      const result = await this.periodicNotesService.createPeriodicNote(
        connector.vaultPath,
        'yearly',
        date,
        args?.variables as Record<string, any> | undefined
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/index.ts:433-445 (registration)
    Registration of the 'create_yearly_note' tool including its description and input schema in the tools list provided to the MCP server.
    {
      name: 'create_yearly_note',
      description: 'Create a yearly note for a specific year',
      inputSchema: {
        type: 'object',
        properties: {
          vault: { type: 'string', description: 'Vault name' },
          date: { type: 'string', description: 'Date in the year (YYYY-MM-DD), defaults to this year' },
          variables: { type: 'object', description: 'Additional template variables' },
        },
        required: ['vault'],
      },
    },
  • Input schema definition for the create_yearly_note tool.
      inputSchema: {
        type: 'object',
        properties: {
          vault: { type: 'string', description: 'Vault name' },
          date: { type: 'string', description: 'Date in the year (YYYY-MM-DD), defaults to this year' },
          variables: { type: 'object', description: 'Additional template variables' },
        },
        required: ['vault'],
      },
    },
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 states 'create' which implies a write operation, but doesn't disclose permissions needed, whether it overwrites existing notes, what happens on invalid inputs, or the format/location of created notes. The description adds no context about side effects, error handling, or system behavior beyond the basic action.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple creation tool and front-loads the core action. Every word earns its place with zero 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?

For a creation tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what a 'yearly note' is, how it differs from regular notes, what template might be used, or what the tool returns. Given the sibling tools include multiple note-creation variants and template-related tools, more context is needed to guide proper usage.

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 all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain how 'date' determines the year, what 'variables' are used for, or why 'vault' is required. With comprehensive schema coverage, the baseline 3 is appropriate as the description doesn't compensate but doesn't detract either.

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 'create' and resource 'yearly note' with the qualifier 'for a specific year', making the purpose unambiguous. It distinguishes from generic 'create_note' but doesn't explicitly differentiate from other periodic note siblings like create_daily_note, create_weekly_note, and create_monthly_note beyond the 'yearly' timeframe.

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 like create_note, create_from_template, or other periodic note tools (daily, weekly, monthly). It doesn't mention prerequisites, typical use cases, or exclusions, leaving the agent to infer context from the tool name alone.

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