goalstory_destroy_goal
Permanently delete a goal and its associated steps and stories from Goal Story MCP Server. Requires confirmation to avoid accidental removal.
Instructions
Remove a goal and all its associated steps and stories from the user's journey. Use with confirmation to prevent accidental deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique identifier of the goal to be permanently removed. |
Implementation Reference
- src/index.ts:325-346 (handler)The handler function for the 'goalstory_destroy_goal' tool. It constructs the API URL `/goals/${id}`, performs a DELETE request using the shared `doRequest` helper, and formats the response as MCP tool output./** * Destroy Goal */ server.tool( DESTROY_GOAL_TOOL.name, DESTROY_GOAL_TOOL.description, DESTROY_GOAL_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/goals/${args.id}`; const result = await doRequest(url, "DELETE"); return { content: [ { type: "text", text: `Goal deleted:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:141-154 (schema)Schema definition for the tool, including name, description, and Zod input schema validating the 'id' parameter./** * DELETE /goals/:id */ export const DESTROY_GOAL_TOOL = { name: "goalstory_destroy_goal", description: "Remove a goal and all its associated steps and stories from the user's journey. Use with confirmation to prevent accidental deletion.", inputSchema: z.object({ id: z .string() .describe("Unique identifier of the goal to be permanently removed."), }), };
- src/types.ts:38-40 (schema)TypeScript interface defining the input shape for destroying a goal.export interface GoalstoryDestroyGoalInput { id: string; }
- src/index.ts:328-346 (registration)Registration of the tool with the MCP server using server.tool, referencing the schema from tools.ts and providing the handler.server.tool( DESTROY_GOAL_TOOL.name, DESTROY_GOAL_TOOL.description, DESTROY_GOAL_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/goals/${args.id}`; const result = await doRequest(url, "DELETE"); return { content: [ { type: "text", text: `Goal deleted:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );