Skip to main content
Glama
hichana

Goal Story MCP Server

by hichana

goalstory_get_story_context

Gather user context including goals, motivations, and beliefs to create personalized stories that enhance goal achievement through meaningful narratives.

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
NameRequiredDescriptionDefault
goalIdYesUnique identifier of the goal for context gathering.
stepIdYesUnique identifier of the specific step for context gathering.
feedbackNoAdditional user input to enhance context understanding.

Implementation Reference

  • The core handler function for the 'goalstory_get_story_context' tool. It takes input arguments (goalId, stepId, optional feedback), builds a query URL for the backend API endpoint '/context', fetches the story context data, and returns it formatted as a text content block.
    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)
    MCP server registration of the tool using server.tool(), specifying the name, description, input schema shape from tools.ts, and the inline 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, }; }, );
  • Tool specification object exported from tools.ts, including the exact name 'goalstory_get_story_context', description, and Zod inputSchema used for validation in the MCP tool registration.
    export const GET_STORY_CONTEXT_TOOL = { name: "goalstory_get_story_context", description: `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.`, 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."), }), };
  • TypeScript interface defining the input type for the tool, matching the Zod schema.
    export interface GoalstoryGetStoryContextInput { goalId: string; stepId: string; feedback?: string; }

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/hichana/goalstory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server