update-task
Modify task details within a Shortcut story, including description, ownership, and completion status, using story and task IDs via the MCP server integration.
Instructions
Update a task in a story
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isCompleted | No | Whether the task is completed or not | |
| storyPublicId | Yes | The public ID of the story | |
| taskDescription | No | The description of the task | |
| taskOwnerIds | No | Array of user IDs to assign as owners of the task | |
| taskPublicId | Yes | The public ID of the task |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"isCompleted": {
"description": "Whether the task is completed or not",
"type": "boolean"
},
"storyPublicId": {
"description": "The public ID of the story",
"exclusiveMinimum": 0,
"type": "number"
},
"taskDescription": {
"description": "The description of the task",
"type": "string"
},
"taskOwnerIds": {
"description": "Array of user IDs to assign as owners of the task",
"items": {
"type": "string"
},
"type": "array"
},
"taskPublicId": {
"description": "The public ID of the task",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"storyPublicId",
"taskPublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/stories.ts:270-284 (registration)Registration of the "stories-update-task" tool (matches "update-task") on the MCP server, including schema and handler reference.server.addToolWithWriteAccess( "stories-update-task", "Update a task in a story", { storyPublicId: z.number().positive().describe("The public ID of the story"), taskPublicId: z.number().positive().describe("The public ID of the task"), taskDescription: z.string().optional().describe("The description of the task"), taskOwnerIds: z .array(z.string()) .optional() .describe("Array of user IDs to assign as owners of the task"), isCompleted: z.boolean().optional().describe("Whether the task is completed or not"), }, async (params) => await tools.updateTask(params), );
- src/tools/stories.ts:274-282 (schema)Zod schema for input validation of the update-task tool parameters: storyPublicId, taskPublicId, taskDescription, taskOwnerIds, isCompleted.storyPublicId: z.number().positive().describe("The public ID of the story"), taskPublicId: z.number().positive().describe("The public ID of the task"), taskDescription: z.string().optional().describe("The description of the task"), taskOwnerIds: z .array(z.string()) .optional() .describe("Array of user IDs to assign as owners of the task"), isCompleted: z.boolean().optional().describe("Whether the task is completed or not"), },
- src/tools/stories.ts:589-624 (handler)Handler function that implements the update-task logic: fetches story and task, calls client.updateTask with provided params, constructs success message.async updateTask({ storyPublicId, taskPublicId, taskDescription, taskOwnerIds, isCompleted, }: { storyPublicId: number; taskPublicId: number; taskDescription?: string; taskOwnerIds?: string[]; isCompleted?: boolean; }) { if (!storyPublicId) throw new Error("Story public ID is required"); if (!taskPublicId) throw new Error("Task public ID is required"); const story = await this.client.getStory(storyPublicId); if (!story) throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`); const task = await this.client.getTask(storyPublicId, taskPublicId); if (!task) throw new Error(`Failed to retrieve Shortcut task with public ID: ${taskPublicId}`); const updatedTask = await this.client.updateTask(storyPublicId, taskPublicId, { description: taskDescription, ownerIds: taskOwnerIds, isCompleted, }); let message = `Updated task for story sc-${storyPublicId}. Task ID: ${updatedTask.id}.`; if (isCompleted) { message = `Completed task for story sc-${storyPublicId}. Task ID: ${updatedTask.id}.`; } return this.toResult(message); }