goalstory_create_story
Create personalized stories that visualize goal achievement using user context and motivations to enhance engagement and progress tracking.
Instructions
Generate and save a highly personalized story that visualizes achievement of the current goal/step. Uses understanding of the user's beliefs, motivations, and context to create engaging mental imagery. If context is needed, gathers it through user discussion and profile data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal_id | Yes | Unique identifier of the goal this story supports. | |
| step_id | Yes | Unique identifier of the specific step this story visualizes. | |
| title | Yes | Engaging headline that captures the essence of the story. | |
| story_text | Yes | Detailed narrative that vividly illustrates goal/step achievement. |
Implementation Reference
- src/index.ts:650-673 (handler)The handler function for the 'goalstory_create_story' tool. It constructs a POST request to the '/stories' endpoint using the provided goal_id, step_id, title, and story_text, then returns the API response.server.tool( CREATE_STORY_TOOL.name, CREATE_STORY_TOOL.description, CREATE_STORY_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/stories`; const body = { goal_id: args.goal_id, step_id: args.step_id, title: args.title, story_text: args.story_text, }; const result = await doRequest(url, "POST", body); return { content: [ { type: "text", text: `Story created:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:349-370 (schema)Zod input schema definition and tool metadata (name, description) for 'goalstory_create_story'.export const CREATE_STORY_TOOL = { name: "goalstory_create_story", description: `Generate and save a highly personalized story that visualizes achievement of the current goal/step. Uses understanding of the user's beliefs, motivations, and context to create engaging mental imagery. If context is needed, gathers it through user discussion and profile data.`, inputSchema: z.object({ goal_id: z .string() .describe("Unique identifier of the goal this story supports."), step_id: z .string() .describe( "Unique identifier of the specific step this story visualizes.", ), title: z .string() .describe("Engaging headline that captures the essence of the story."), story_text: z .string() .describe( "Detailed narrative that vividly illustrates goal/step achievement.", ), }), };
- src/types.ts:101-106 (schema)TypeScript interface defining the input shape for GoalstoryCreateStoryInput.export interface GoalstoryCreateStoryInput { goal_id: string; step_id: string; title?: string; story_text: string; }
- src/index.ts:18-43 (registration)Import of CREATE_STORY_TOOL which is used to register the tool in the MCP server.ABOUT_GOALSTORYING_TOOL, COUNT_GOALS_TOOL, CREATE_GOAL_TOOL, CREATE_SCHEDULED_STORY_TOOL, CREATE_STEPS_TOOL, CREATE_STORY_TOOL, DESTROY_GOAL_TOOL, DESTROY_SCHEDULED_STORY_TOOL, DESTROY_STEP_TOOL, GET_STORY_CONTEXT_TOOL, READ_CURRENT_FOCUS_TOOL, READ_GOALS_TOOL, READ_ONE_GOAL_TOOL, READ_ONE_STEP_TOOL, READ_ONE_STORY_TOOL, READ_SCHEDULED_STORIES_TOOL, READ_SELF_USER_TOOL, READ_STEPS_TOOL, READ_STORIES_TOOL, SET_STEPS_ORDER_TOOL, UPDATE_GOAL_TOOL, UPDATE_SCHEDULED_STORY_TOOL, UPDATE_SELF_USER_TOOL, UPDATE_STEP_NOTES_TOOL, UPDATE_STEP_TOOL, } from "./tools.js";