Skip to main content
Glama

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

NameRequiredDescriptionDefault
isCompletedNoWhether the task is completed or not
storyPublicIdYesThe public ID of the story
taskDescriptionNoThe description of the task
taskOwnerIdsNoArray of user IDs to assign as owners of the task
taskPublicIdYesThe 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

  • 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), );
  • 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"), },
  • 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); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/useshortcut/mcp-server-shortcut'

If you have feedback or need assistance with the MCP directory API, please join our Discord server