Skip to main content
Glama
coji

Journal MCP Server

by coji

get_entry_by_date

Retrieve a personal journal entry for a specific date using YYYY-MM-DD format to access past reflections and records.

Instructions

Get journal entry for a specific date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesDate in YYYY-MM-DD format

Implementation Reference

  • Core implementation of getEntryByDate: retrieves the journal file for the specified date, reads its content, parses it into a JournalFile structure using parseJournalFile, or returns null if not found or parsing fails.
    export async function getEntryByDate(
      date: string
    ): Promise<JournalFile | null> {
      const filePath = getDateFilePath(date);
      const content = await readFileIfExists(filePath);
    
      if (!content) return null;
    
      try {
        return await parseJournalFile(filePath, content);
      } catch {
        return null;
      }
    }
  • Registers the 'get_entry_by_date' MCP tool, defines its input schema (date: string), calls the handler function, and formats the response as text content.
    this.server.tool(
      'get_entry_by_date',
      'Get journal entry for a specific date',
      {
        date: z.string().describe('Date in YYYY-MM-DD format'),
      },
      async ({ date }) => {
        const entry = await getEntryByDate(date);
    
        if (!entry) {
          return {
            content: [
              {
                type: 'text',
                text: `📅 No journal entry found for ${date}`,
              },
            ],
          } satisfies CallToolResult;
        }
    
        let response = `📅 Journal Entry for ${entry.date}\n\n`;
        response += `**Tags:** ${entry.tags.join(', ') || 'None'}\n`;
        response += `**Entries:** ${entry.entries_count}\n`;
        response += `**Created:** ${new Date(
          entry.created
        ).toLocaleString()}\n`;
        response += `**Updated:** ${new Date(
          entry.updated
        ).toLocaleString()}\n\n`;
    
        for (const entryItem of entry.entries) {
          response += `## ${entryItem.timestamp} - ${entryItem.title}\n`;
          response += `${entryItem.content}\n\n`;
        }
    
        return {
          content: [
            {
              type: 'text',
              text: response,
            },
          ],
        } satisfies CallToolResult;
      }
  • Input schema for the tool using Zod: requires a 'date' string in YYYY-MM-DD format.
      date: z.string().describe('Date in YYYY-MM-DD format'),
    },
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 of behavioral disclosure. It states 'Get journal entry' but doesn't describe what happens if no entry exists for the date (e.g., returns null, error, or empty response), authentication requirements, rate limits, or return format. This leaves significant gaps for a tool that likely interacts with data storage.

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 front-loads the core purpose ('Get journal entry for a specific date') with zero wasted words. Every part of the sentence contributes directly to understanding the tool's function, making it appropriately sized and well-structured.

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 lack of annotations and output schema, the description is incomplete for a data retrieval tool. It doesn't explain return values (e.g., entry content, metadata, or error cases), behavioral traits like idempotency, or how it differs from siblings. For a tool with one parameter but potential complexity in data access, more context is needed.

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 input schema has 100% description coverage, with the 'date' parameter fully documented in the schema as 'Date in YYYY-MM-DD format'. The description adds no additional parameter semantics beyond implying the date is used to fetch a specific entry, so it meets the baseline for high schema coverage without compensating value.

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 ('Get') and resource ('journal entry') with specific scope ('for a specific date'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'get_recent_entries' or 'search_entries' that might also retrieve entries, which prevents a perfect score.

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 'get_recent_entries' or 'search_entries'. It mentions 'specific date' but doesn't clarify if this is for exact date matching only or if there are edge cases (e.g., no entry exists for that date). No explicit when/when-not instructions or prerequisites are included.

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/coji/journal-mcp'

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