goalstory_create_goal
Create a new goal to begin the clarification process, then refine it through discussion to ensure it's well-defined and aligned with your aspirations.
Instructions
Begin the goal clarification process by creating a new goal. Always discuss and refine the goal with the user before or after saving, ensuring it's well-defined and aligned with their aspirations. Confirm if any adjustments are needed after creation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Clear and specific title that captures the essence of the goal. | |
| description | No | Detailed explanation of the goal, including context, motivation, and desired outcomes. | |
| story_mode | No | Narrative approach that shapes how future stories visualize goal achievement. | |
| belief_mode | No | Framework defining how the user's core beliefs and values influence this goal. |
Implementation Reference
- src/index.ts:244-279 (handler)The handler function that executes the 'goalstory_create_goal' tool. It constructs the request body from the input arguments and sends a POST request to the backend API at /goals, returning the created goal data.server.tool( CREATE_GOAL_TOOL.name, CREATE_GOAL_TOOL.description, CREATE_GOAL_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/goals`; const body = { name: args.name, ...(args.description ? { description: args.description, } : {}), ...(args.story_mode ? { story_mode: args.story_mode, } : {}), ...(args.belief_mode ? { belief_mode: args.belief_mode, } : {}), }; const result = await doRequest(url, "POST", body); return { content: [ { type: "text", text: `Goal created:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:66-94 (schema)Defines the tool metadata including name, description, and Zod input schema for 'goalstory_create_goal'.export const CREATE_GOAL_TOOL = { name: "goalstory_create_goal", description: `Begin the goal clarification process by creating a new goal. Always discuss and refine the goal with the user before or after saving, ensuring it's well-defined and aligned with their aspirations. Confirm if any adjustments are needed after creation.`, inputSchema: z.object({ name: z .string() .describe( "Clear and specific title that captures the essence of the goal.", ), description: z .string() .optional() .describe( "Detailed explanation of the goal, including context, motivation, and desired outcomes.", ), story_mode: z .string() .optional() .describe( "Narrative approach that shapes how future stories visualize goal achievement.", ), belief_mode: z .string() .optional() .describe( "Framework defining how the user's core beliefs and values influence this goal.", ), }), };
- src/index.ts:244-279 (registration)Registers the 'goalstory_create_goal' tool with the MCP server using server.tool(), referencing the definition from tools.ts and providing the handler function.server.tool( CREATE_GOAL_TOOL.name, CREATE_GOAL_TOOL.description, CREATE_GOAL_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/goals`; const body = { name: args.name, ...(args.description ? { description: args.description, } : {}), ...(args.story_mode ? { story_mode: args.story_mode, } : {}), ...(args.belief_mode ? { belief_mode: args.belief_mode, } : {}), }; const result = await doRequest(url, "POST", body); return { content: [ { type: "text", text: `Goal created:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );