goalstory_get_story_context
Gather user-specific context, including goals, steps, beliefs, and motivations, to craft personalized stories. Integrates profile data and conversational insights for tailored narrative creation.
Instructions
Gather rich context about the user, their current goal/step, beliefs, and motivations to create deeply personalized and meaningful stories. Combines user profile data with conversation insights.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feedback | No | Additional user input to enhance context understanding. | |
| goalId | Yes | Unique identifier of the goal for context gathering. | |
| stepId | Yes | Unique identifier of the specific step for context gathering. |
Implementation Reference
- src/index.ts:423-439 (handler)The handler function for 'goalstory_get_story_context' tool. It constructs URL query parameters from input (goalId, stepId, optional feedback), makes a GET request to the backend API endpoint '/context', and returns the response as formatted text content.async (args) => { const params = new URLSearchParams(); params.set("goalId", args.goalId); params.set("stepId", args.stepId); if (args.feedback) params.set("feedback", args.feedback); const url = `${GOALSTORY_API_BASE_URL}/context?${params.toString()}`; const result = await doRequest(url, "GET"); return { content: [ { type: "text", text: `Story context:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; },
- src/index.ts:419-440 (registration)The MCP server.tool registration call that registers the 'goalstory_get_story_context' tool, specifying its name, description, input schema, and handler function.server.tool( GET_STORY_CONTEXT_TOOL.name, GET_STORY_CONTEXT_TOOL.description, GET_STORY_CONTEXT_TOOL.inputSchema.shape, async (args) => { const params = new URLSearchParams(); params.set("goalId", args.goalId); params.set("stepId", args.stepId); if (args.feedback) params.set("feedback", args.feedback); const url = `${GOALSTORY_API_BASE_URL}/context?${params.toString()}`; const result = await doRequest(url, "GET"); return { content: [ { type: "text", text: `Story context:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:202-216 (schema)Zod input schema definition for the 'goalstory_get_story_context' tool, defining required goalId and stepId strings, and optional feedback string.inputSchema: z.object({ goalId: z .string() .describe("Unique identifier of the goal for context gathering."), stepId: z .string() .describe( "Unique identifier of the specific step for context gathering.", ), feedback: z .string() .optional() .describe("Additional user input to enhance context understanding."), }), };
- src/types.ts:56-60 (schema)TypeScript interface defining the input shape for the 'goalstory_get_story_context' tool.export interface GoalstoryGetStoryContextInput { goalId: string; stepId: string; feedback?: string; }