set_journal
Set the active journal for operations in the jrnl MCP Server. Use this tool to specify the journal name for tasks like searching entries, listing tags, or viewing statistics.
Instructions
Set the active journal for subsequent operations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| journalName | Yes | Name of the journal to set as active |
Implementation Reference
- src/handlers/journalHandlers.ts:60-69 (handler)The core implementation of the set_journal tool handler. Sets the currentJournal variable in memory and returns a success response with the new current journal.export async function setJournal( journalName: string, ): Promise<{ success: boolean; currentJournal: string }> { currentJournal = journalName; return { success: true, currentJournal: journalName, }; }
- src/index.ts:131-140 (schema)Input schema definition for the set_journal tool, specifying that journalName is a required string.inputSchema: { type: "object", properties: { journalName: { type: "string", description: "Name of the journal to set as active", }, }, required: ["journalName"], },
- src/index.ts:128-141 (registration)Registration of the set_journal tool in the MCP server's list of available tools, including schema and description.{ name: "set_journal", description: "Set the active journal for subsequent operations", inputSchema: { type: "object", properties: { journalName: { type: "string", description: "Name of the journal to set as active", }, }, required: ["journalName"], }, },
- src/index.ts:229-243 (registration)Dispatcher case in CallToolRequestHandler that invokes the setJournal handler for the set_journal tool.case "set_journal": return { content: [ { type: "text", text: JSON.stringify( await setJournal( typeof args?.journalName === "string" ? args.journalName : "", ), null, 2, ), }, ], };