Skip to main content
Glama
yostos
by yostos

set_journal

Select which journal to use for searching entries, listing tags, and viewing statistics in the command-line journal system.

Instructions

Set the active journal for subsequent operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
journalNameYesName of the journal to set as active

Implementation Reference

  • The core handler function that implements the logic for the 'set_journal' tool. It sets a module-level 'currentJournal' variable to the provided journalName and returns a success response.
    export async function setJournal(
      journalName: string,
    ): Promise<{ success: boolean; currentJournal: string }> {
      currentJournal = journalName;
    
      return {
        success: true,
        currentJournal: journalName,
      };
    }
  • src/index.ts:128-141 (registration)
    Registers the 'set_journal' tool with the MCP server by including it in the list of available tools returned by ListToolsRequestHandler. Includes the tool's input schema for validation.
    {
      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"],
      },
    },
  • Defines the input schema for the 'set_journal' tool, specifying that it requires a 'journalName' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        journalName: {
          type: "string",
          description: "Name of the journal to set as active",
        },
      },
      required: ["journalName"],
    },
  • The dispatch handler in the CallToolRequestHandler that invokes the setJournal function when 'set_journal' is called, formats the response as MCP content.
    case "set_journal":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await setJournal(
                typeof args?.journalName === "string" ? args.journalName : "",
              ),
              null,
              2,
            ),
          },
        ],
      };

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