Skip to main content
Glama
yostos
by yostos

list_journals

Retrieve all available journals from the command-line journal system to view and manage your recorded entries.

Instructions

List all available journals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'list_journals' tool. Executes 'jrnl --list' via executor, parses the output to identify journals (with default marker), structures as JournalInfo array with optional currentJournal, and handles parsing errors.
    export async function listJournals(
      executor: JrnlExecutor,
    ): Promise<{ journals: JournalInfo[]; currentJournal?: string }> {
      const command = buildListJournalsCommand();
      const result = await executor.execute(command);
    
      try {
        // Parse jrnl --list output
        // Format can be:
        // Journals defined in config (/path/to/config)
        // * default -> /path/to/default.txt
        //   work -> /path/to/work.txt
        const lines = result.trim().split("\n");
        const journals: JournalInfo[] = [];
    
        for (const line of lines) {
          // Skip header lines
          if (line.includes("Journals defined in config") || line.trim() === "") {
            continue;
          }
    
          const match = line.match(/^(\s*\*?\s*)(\w+)\s*->\s*(.+)$/);
          if (match) {
            const isDefault = line.trim().startsWith("*");
            const name = match[2].trim();
            const path = match[3].trim();
    
            journals.push({
              name,
              path,
              isDefault,
            });
    
            if (isDefault && !currentJournal) {
              currentJournal = name;
            }
          }
        }
    
        return {
          journals,
          currentJournal,
        };
      } catch (error) {
        throw new Error(`Failed to parse journal list: ${error}`);
      }
    }
  • Type definition for journal information returned by listJournals handler.
    export interface JournalInfo {
      name: string;
      path: string;
      isDefault: boolean;
    }
  • src/index.ts:120-127 (registration)
    Registers the 'list_journals' tool in the MCP server's tool list, including name, description, and empty input schema (no parameters required).
    {
      name: "list_journals",
      description: "List all available journals",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:219-227 (registration)
    Dispatch handler in CallToolRequestSchema that invokes listJournals(executor) and formats response as JSON text content.
    case "list_journals":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(await listJournals(executor), null, 2),
          },
        ],
      };
  • Helper function that constructs the 'jrnl --list' command arguments, used by the listJournals handler.
    export function buildListJournalsCommand(): string[] {
      return ["--list"];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states a read operation ('List') but doesn't describe return format, pagination, sorting, error conditions, or any other behavioral traits. This is inadequate for a tool with zero 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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple listing tool.

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. It doesn't explain what 'journals' are in this context, what data is returned, or how this tool relates to siblings like 'set_journal'. For a tool with no structured metadata, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description appropriately doesn't discuss parameters, which is correct for a parameterless tool, earning a baseline score of 4.

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 ('List') and resource ('journals') with scope ('all available'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_tags' or 'search_entries' beyond the resource name, 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 'search_entries' or 'list_tags'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage 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/yostos/jrnl-mcp'

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