update-task
Modify task details in Shortcut stories including description, assignees, and completion status to keep project work organized and current.
Instructions
Update a task in a story
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storyPublicId | Yes | The public ID of the story | |
| taskPublicId | Yes | The public ID of the task | |
| taskDescription | No | The description of the task | |
| taskOwnerIds | No | Array of user IDs to assign as owners of the task | |
| isCompleted | No | Whether the task is completed or not |
Input Schema (JSON Schema)
{
"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:548-583 (handler)The main handler function for the 'update-task' tool. It validates inputs, fetches the story and task, updates the task using the Shortcut client, and returns a result 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); }
- src/tools/stories.ts:265-274 (schema)Zod schema defining the input parameters for the 'update-task' tool.{ 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:262-276 (registration)Registers the 'update-task' MCP tool on the server, providing description, input schema, and handler reference.server.tool( "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), );