Skip to main content
Glama

get_daily_note

Retrieve today's daily note or access notes from specific dates in your Obsidian vault using date-based queries.

Instructions

Get today's daily note or a specific date's daily note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format (defaults to today)

Implementation Reference

  • The handler implementation for the 'get_daily_note' tool, which retrieves and returns the content of a daily note based on a date.
    server.registerTool(
      "get_daily_note",
      {
        description: "Get today's daily note or a specific date's daily note",
        inputSchema: {
          date: z
            .string()
            .optional()
            .describe(
              "Date in YYYY-MM-DD format (defaults to today)",
            ),
        },
      },
      async ({ date }) => {
        try {
          const config = getDailyNoteConfig(vaultPath);
          const targetDate = date ?? new Date().toISOString().slice(0, 10);
    
          // Build the filename from the configured format
          // Replace common date tokens with actual date parts
          const [year, month, day] = targetDate.split("-");
          let filename = config.format
            .replace("YYYY", year)
            .replace("MM", month)
            .replace("DD", day);
    
          if (!filename.endsWith(".md")) {
            filename += ".md";
          }
    
          const notePath = config.folder
            ? `${config.folder}/${filename}`
            : filename;
    
          let content: string;
          try {
            content = await readNote(vaultPath, notePath);
          } catch {
            return errorResult(`Daily note not found for ${targetDate} (expected at "${notePath}")`);
          }
    
          const { data: dailyFrontmatter, content: dailyBody } = parseFrontmatter(content);
          const header: string[] = [
            `Daily Note: ${targetDate}`,
            `Path: ${notePath}`,
            "",
          ];
    
          if (Object.keys(dailyFrontmatter).length > 0) {
            header.push("--- Frontmatter ---");
            for (const [key, value] of Object.entries(dailyFrontmatter)) {
              header.push(`${key}: ${JSON.stringify(value)}`);
            }
            header.push("--- End Frontmatter ---");
            header.push("");
          }
    
          return {
            content: [
              { type: "text" as const, text: header.join("\n") + dailyBody },
            ],
          };
        } catch (err) {
          console.error("get_daily_note error:", err);
          return errorResult(`Error reading daily note: ${err instanceof Error ? err.message : String(err)}`);
        }
      },
    );
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 the tool retrieves notes, implying a read-only operation, but doesn't address potential side effects, error conditions, authentication needs, or what happens if a note doesn't exist for the given date. This leaves significant gaps for a tool with no annotation coverage.

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 with no wasted words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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

Completeness3/5

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

Given the tool's low complexity (1 optional parameter) and 100% schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it should ideally provide more behavioral context about what's returned (e.g., note content, metadata, or error handling) to be fully 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 schema description coverage is 100%, so the schema already documents the single 'date' parameter with its format and default. The description adds marginal value by mentioning 'today's daily note' which aligns with the default, but doesn't provide additional semantic context beyond what's in the schema.

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 ('Get') and resource ('daily note'), specifying it can retrieve today's note or one for a specific date. It distinguishes from siblings like 'get_note' by focusing on daily notes, but doesn't explicitly contrast with other retrieval tools like 'get_backlinks' or 'get_tags'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving daily notes, but provides no explicit guidance on when to use this versus alternatives like 'get_note' or 'search_notes'. It mentions the default behavior (today's note) which gives some context, but lacks clear when/when-not instructions or named alternatives.

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

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