Something went wrong. Try again.
🐱 Medium-horizon agent planning MCP server
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556/** * 9plan_session_create tool * * Creates a new session with a randomly-generated three-word identifier. */
import { z } from "zod";import { createNewSession, getSessionPath } from "../container.js";import { formatResponse } from "../types.js";
// Input schemaexport const sessionCreateInputSchema = { task_description: z .string() .optional() .describe("Optional description of the overall task this session is for"),};
// Input type derived from schemaexport interface SessionCreateInput { task_description?: string;}
/** * Handle session create tool call */export function handleSessionCreate( args: SessionCreateInput,): { content: { type: "text"; text: string }[] } { const { sessionName, store } = createNewSession(args.task_description); const sessionPath = getSessionPath(sessionName);
// Close the store since we're just creating the session store.close();
const response = formatResponse( sessionName, `Session created: ${sessionName}Directory: ${sessionPath}
The session is ready. Use 9plan_queue_add to add plans, then 9plan_queue_pull to begin work.`, );
return { content: [{ type: "text", text: response }], };}
// Tool configuration for registrationexport const sessionCreateToolConfig = { title: "Create Session", description: "Creates a new session with a randomly-generated three-word identifier (e.g., amber-quiet-river). Optionally provide a task description to document the overall goal.", inputSchema: sessionCreateInputSchema,};