goalstory_count_goals
Calculates the total number of goals in a user’s journey, enabling efficient progress tracking and insights into goal management patterns for enhanced productivity.
Instructions
Get the total number of goals in the user's journey. Useful for tracking overall progress and goal management patterns.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:222-239 (handler)The handler function for 'goalstory_count_goals' is registered here via server.tool(). It performs a GET request to the '/count/goals' API endpoint and returns the count of goals in a formatted text response.server.tool( COUNT_GOALS_TOOL.name, COUNT_GOALS_TOOL.description, COUNT_GOALS_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/count/goals`; const result = await doRequest(url, "GET"); return { content: [ { type: "text", text: `Count of goals:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:56-61 (schema)Tool schema definition including name, description, and empty input schema (z.object({})). This object is imported and used in the handler registration.export const COUNT_GOALS_TOOL = { name: "goalstory_count_goals", description: "Get the total number of goals in the user's journey. Useful for tracking overall progress and goal management patterns.", inputSchema: z.object({}), };
- src/index.ts:222-239 (registration)Registration of the 'goalstory_count_goals' tool using McpServer's server.tool() method, referencing the schema from tools.ts and providing the inline handler.server.tool( COUNT_GOALS_TOOL.name, COUNT_GOALS_TOOL.description, COUNT_GOALS_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/count/goals`; const result = await doRequest(url, "GET"); return { content: [ { type: "text", text: `Count of goals:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );