Skip to main content
Glama
bazylhorsey
by bazylhorsey

create_weekly_note

Generate a weekly note for a specific date in your Obsidian vault, using templates and custom variables to organize your schedule and tasks.

Instructions

Create a weekly note for a specific date

Input Schema

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

Implementation Reference

  • Core implementation of periodic note creation (used for weekly notes by passing 'weekly' type). Handles path generation, template rendering or default content, directory creation, and file writing.
    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 dispatch handler case that extracts parameters and calls PeriodicNotesService.createPeriodicNote with type 'weekly'.
    case 'create_weekly_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,
        'weekly',
        date,
        args?.variables as Record<string, any> | undefined
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Schema definition and registration of the create_weekly_note tool in the ListTools response.
    {
      name: 'create_weekly_note',
      description: 'Create a weekly note for a specific date',
      inputSchema: {
        type: 'object',
        properties: {
          vault: { type: 'string', description: 'Vault name' },
          date: { type: 'string', description: 'Date in the week (YYYY-MM-DD), defaults to this week' },
          variables: { type: 'object', description: 'Additional template variables' },
        },
        required: ['vault'],
      },
    },
  • Helper function getDateRange specific logic for weekly notes, calculating Monday to Sunday range.
    case 'weekly':
      // Start on Monday
      const day = start.getDay();
      const diff = start.getDate() - day + (day === 0 ? -6 : 1);
      start.setDate(diff);
      start.setHours(0, 0, 0, 0);
      end.setDate(start.getDate() + 6);
      end.setHours(23, 59, 59, 999);
      break;
  • Weekly-specific default content generation in generateDefaultContent helper.
    case 'weekly':
      content += `## Week ${vars.week} Overview\n\n`;
      content += `**Period:** ${vars.startDate} to ${vars.endDate}\n\n`;
      content += `## Goals\n\n- \n\n## Reflection\n\n`;
      break;
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. It states 'create' which implies a write/mutation operation, but doesn't disclose any behavioral traits: no information about permissions required, whether it overwrites existing notes, what happens on failure, rate limits, or what the created note contains (e.g., template-based structure). For a creation tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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: 'Create a weekly note for a specific date'. It's front-loaded with the core action and resource, and every word earns its place. No redundant or verbose phrasing.

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 the complexity (a creation tool with 3 parameters, no annotations, and no output schema), the description is incomplete. It doesn't explain what a 'weekly note' entails (e.g., based on templates, includes sections), behavioral aspects like idempotency or error handling, or how it differs from other note-creation tools. With no annotations to cover safety or mutability, and no output schema to describe results, the description should provide more context to be fully helpful.

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 all three parameters (date, variables, vault) with their descriptions. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain how 'date' relates to 'weekly' (e.g., picks the week containing that date), what 'variables' are used for, or why 'vault' is required. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with extra context.

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 the resource 'weekly note', with the specific scope 'for a specific date'. It distinguishes from siblings like create_daily_note, create_monthly_note, and create_yearly_note by specifying the weekly period, but doesn't explicitly differentiate from create_note or create_from_template which might also create notes. The purpose is clear but could be more specific about what makes this tool unique among note-creation tools.

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_daily_note, create_monthly_note, create_yearly_note, create_note, or create_from_template. It mentions 'for a specific date' but doesn't explain why you'd choose weekly over other periodic notes or general note creation. There's no mention of prerequisites, exclusions, or contextual triggers for usage.

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