Skip to main content
Glama
yostos
by yostos

search_entries

Search and filter journal entries by date, tags, text content, or starred status to find specific records in your journal.

Instructions

Search and filter journal entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoStart date (e.g., "yesterday", "2024-01-01")
toNoEnd date
tagsNoTags to filter by
containsNoText to search for
limitNoMaximum number of entries
starredNoOnly show starred entries
journalNoJournal name (uses current/default if not specified)

Implementation Reference

  • Core handler function that builds a search command using filters from params, executes it via JrnlExecutor, parses the JSON output, transforms entries to JournalEntry format, and returns entries and tag counts.
    export async function searchEntries(
      params: SearchEntriesParams,
      executor: JrnlExecutor,
    ): Promise<{ entries: JournalEntry[]; tags: Record<string, number> }> {
      const filters: SearchFilters = {
        from: params.from,
        to: params.to,
        tags: params.tags,
        contains: params.contains,
        limit: params.limit,
        starred: params.starred,
      };
    
      const command = buildSearchCommand(filters, params.journal);
      const result = await executor.execute(command);
    
      try {
        const data = JSON.parse(result);
    
        // jrnl exports in a specific format, need to transform it
        const entries: JournalEntry[] = data.entries.map((entry: any) => ({
          date: entry.date,
          time: entry.time || "",
          title: entry.title || "",
          body: entry.body || "",
          tags: entry.tags || [],
          starred: entry.starred || false,
        }));
    
        return {
          entries,
          tags: data.tags || {},
        };
      } catch (error) {
        throw new Error(`Failed to parse jrnl output: ${error}`);
      }
    }
  • TypeScript interface defining the input parameters for the searchEntries tool.
    export interface SearchEntriesParams {
      from?: string;
      to?: string;
      tags?: string[];
      contains?: string;
      limit?: number;
      starred?: boolean;
      journal?: string;
    }
  • TypeScript interface defining the structure of journal entries returned by the tool.
    export interface JournalEntry {
      date: string;
      time: string;
      title: string;
      body: string;
      tags: string[];
      starred: boolean;
    }
  • src/index.ts:37-64 (registration)
    MCP tool registration including name, description, and input schema definition in the ListToolsRequestHandler.
      name: "search_entries",
      description: "Search and filter journal entries",
      inputSchema: {
        type: "object",
        properties: {
          from: {
            type: "string",
            description: 'Start date (e.g., "yesterday", "2024-01-01")',
          },
          to: { type: "string", description: "End date" },
          tags: {
            type: "array",
            items: { type: "string" },
            description: "Tags to filter by",
          },
          contains: { type: "string", description: "Text to search for" },
          limit: { type: "number", description: "Maximum number of entries" },
          starred: {
            type: "boolean",
            description: "Only show starred entries",
          },
          journal: {
            type: "string",
            description: "Journal name (uses current/default if not specified)",
          },
        },
      },
    },
  • src/index.ts:154-166 (registration)
    Dispatcher case in CallToolRequestHandler that invokes the searchEntries handler with parameters and current journal.
    case "search_entries":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await searchEntries({ ...args, journal } as any, executor),
              null,
              2,
            ),
          },
        ],
      };
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. 'Search and filter' implies a read-only operation, but it doesn't specify whether this requires authentication, what the return format looks like (e.g., list of entries with fields), or any rate limits. For a tool with 7 parameters and no output schema, this leaves significant gaps in understanding how the tool behaves and what to expect from its execution.

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 phrase ('Search and filter journal entries') that front-loads the core purpose without unnecessary words. Every part earns its place by specifying both the action and target resource. There is no redundancy or fluff, making it highly concise and well-structured for quick comprehension.

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 tool's complexity (7 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns (e.g., a list of entry objects), how results are ordered, or any behavioral nuances like pagination or error handling. While the schema covers parameters well, the lack of output information and behavioral context makes this inadequate for a tool with multiple filtering options.

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, providing clear documentation for all 7 parameters (e.g., 'from' as 'Start date', 'journal' with default behavior). The description adds no parameter-specific information beyond the schema, so it doesn't enhance semantic understanding. According to the rules, with high schema coverage (>80%), the baseline is 3, which is appropriate here as the description doesn't compensate but also doesn't detract.

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 'Search and filter journal entries' clearly states the verb ('search and filter') and resource ('journal entries'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'analyze_tag_cooccurrence' or 'get_statistics' by focusing on entry retrieval rather than analysis or statistics. However, it doesn't specify the scope (e.g., 'all entries' vs 'recent 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. It doesn't mention prerequisites (e.g., whether a journal must be selected first), nor does it differentiate from sibling tools like 'list_journals' or 'list_tags' that might serve related purposes. The agent must infer usage from the tool name alone, which is insufficient for optimal selection.

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/yostos/jrnl-mcp'

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