goalstory_update_scheduled_story
Modify scheduled story generation settings including timing and activation status to customize automated goal narratives.
Instructions
Update the configuration of a scheduled story generation, such as changing the time or its status (active/paused).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique identifier of the scheduled story configuration to update. | |
| timeSettings | No | Specifies the time of day (hour and minute) for the scheduled story generation. | |
| status | No | Status of the scheduled story: 0 = Active, 1 = Paused. Check ScheduledStoryStatus enum for exact values if available. |
Implementation Reference
- src/index.ts:778-800 (handler)The handler logic is provided inline in the MCP server.tool registration. It constructs a PATCH request to the GoalStory API endpoint `/schedules/stories/{id}` with the provided id, optional timeSettings, and optional status (0=Active, 1=Paused), then returns the formatted response.server.tool( UPDATE_SCHEDULED_STORY_TOOL.name, UPDATE_SCHEDULED_STORY_TOOL.description, UPDATE_SCHEDULED_STORY_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/schedules/stories/${args.id}`; const body = { id: args.id, ...(args.timeSettings ? { timeSettings: args.timeSettings } : {}), ...(typeof args.status === "number" ? { status: args.status } : {}), }; const result = await doRequest(url, "PATCH", body); return { content: [ { type: "text", text: `Scheduled story updated:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );
- src/tools.ts:508-526 (schema)Zod input schema for the tool, defining required 'id' string, optional 'timeSettings' (references TimeSettingsSchema), and optional 'status' number.export const UPDATE_SCHEDULED_STORY_TOOL = { name: "goalstory_update_scheduled_story", description: "Update the configuration of a scheduled story generation, such as changing the time or its status (active/paused).", inputSchema: z.object({ id: z .string() .describe( "Unique identifier of the scheduled story configuration to update.", ), timeSettings: TimeSettingsSchema.optional(), status: z .number() .optional() .describe( "Status of the scheduled story: 0 = Active, 1 = Paused. Check ScheduledStoryStatus enum for exact values if available.", ), }), };
- src/tools.ts:412-465 (schema)Supporting Zod schema for timeSettings input: hour (1-12), period (AM/PM), utcOffset (various timezones). Used in the main tool schema.export const TimeSettingsSchema = z .object({ hour: z.enum([ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", ]), period: z.enum(["AM", "PM"]), utcOffset: z .enum([ "-12:00", "-11:00", "-10:00", "-09:00", "-08:00", "-07:00", "-06:00", "-05:00", "-04:00", "-03:00", "-02:00", "-01:00", "±00:00", "+01:00", "+02:00", "+03:00", "+04:00", "+05:00", "+06:00", "+07:00", "+08:00", "+09:00", "+10:00", "+11:00", "+12:00", "+13:00", "+14:00", ]) .describe( "Choose a current UTC offset based on the user's location (accounting for adjustments like daylight savings time for instance). For example, the UTC offset for Los Angeles, California is -08:00 during standard time (PST, Pacific Standard Time) and -07:00 during daylight saving time (PDT, Pacific Daylight Time).", ), }) .describe( "Specifies the time of day (hour and minute) for the scheduled story generation.", );
- src/index.ts:778-800 (registration)MCP server.tool call that registers the tool with name, description, inputSchema from tools.ts, and inline handler.server.tool( UPDATE_SCHEDULED_STORY_TOOL.name, UPDATE_SCHEDULED_STORY_TOOL.description, UPDATE_SCHEDULED_STORY_TOOL.inputSchema.shape, async (args) => { const url = `${GOALSTORY_API_BASE_URL}/schedules/stories/${args.id}`; const body = { id: args.id, ...(args.timeSettings ? { timeSettings: args.timeSettings } : {}), ...(typeof args.status === "number" ? { status: args.status } : {}), }; const result = await doRequest(url, "PATCH", body); return { content: [ { type: "text", text: `Scheduled story updated:\n${JSON.stringify(result, null, 2)}`, }, ], isError: false, }; }, );