Skip to main content
Glama

add-task-to-story

Add tasks to Shortcut stories with descriptions and assign owners to organize project work and track responsibilities.

Instructions

Add a task to a story

Input Schema

NameRequiredDescriptionDefault
storyPublicIdYesThe public ID of the story
taskDescriptionYesThe description of the task
taskOwnerIdsNoArray of user IDs to assign as owners of the task

Input Schema (JSON Schema)

{ "properties": { "storyPublicId": { "description": "The public ID of the story", "exclusiveMinimum": 0, "type": "number" }, "taskDescription": { "description": "The description of the task", "minLength": 1, "type": "string" }, "taskOwnerIds": { "description": "Array of user IDs to assign as owners of the task", "items": { "type": "string" }, "type": "array" } }, "required": [ "storyPublicId", "taskDescription" ], "type": "object" }

Implementation Reference

  • The main handler function that implements the logic to add a task to a Shortcut story by calling the client.addTaskToStory method after validation.
    async addTaskToStory({ storyPublicId, taskDescription, taskOwnerIds, }: { storyPublicId: number; taskDescription: string; taskOwnerIds?: string[]; }) { if (!storyPublicId) throw new Error("Story public ID is required"); if (!taskDescription) throw new Error("Task description is required"); const story = await this.client.getStory(storyPublicId); if (!story) throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`); if (taskOwnerIds?.length) { const owners = await this.client.getUserMap(taskOwnerIds as string[]); if (!owners) throw new Error(`Failed to retrieve users with IDs: ${taskOwnerIds.join(", ")}`); } const task = await this.client.addTaskToStory(storyPublicId, { description: taskDescription, ownerIds: taskOwnerIds, }); return this.toResult(`Created task for story sc-${storyPublicId}. Task ID: ${task.id}.`); }
  • Zod input schema defining parameters for the tool: storyPublicId (required number), taskDescription (required string), taskOwnerIds (optional array of strings).
    { storyPublicId: z.number().positive().describe("The public ID of the story"), taskDescription: z.string().min(1).describe("The description of the task"), taskOwnerIds: z .array(z.string()) .optional() .describe("Array of user IDs to assign as owners of the task"), },
  • MCP server tool registration for 'add-task-to-story', linking the schema and handler.
    server.tool( "add-task-to-story", "Add a task to a story", { storyPublicId: z.number().positive().describe("The public ID of the story"), taskDescription: z.string().min(1).describe("The description of the task"), taskOwnerIds: z .array(z.string()) .optional() .describe("Array of user IDs to assign as owners of the task"), }, async (params) => await tools.addTaskToStory(params), );

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/ampcome-mcps/shortcut-mcp'

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