stories-remove-subtask
Convert a sub-task into a standalone story by removing its parent relationship in Shortcut project management.
Instructions
Remove a story from its parent. The sub-task will become a regular story.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subTaskPublicId | Yes | The public ID of the sub-task story |
Implementation Reference
- src/tools/stories.ts:545-556 (handler)Handler function that fetches the subtask story and updates it by setting parent_story_id to null, effectively removing it from its parent.async removeSubTaskFromParent({ subTaskPublicId }: { subTaskPublicId: number }) { if (!subTaskPublicId) throw new Error("ID of sub-task story is required"); const subTask = await this.client.getStory(subTaskPublicId); if (!subTask) throw new Error(`Failed to retrieve story with public ID: ${subTaskPublicId}`); await this.client.updateStory(subTaskPublicId, { parent_story_id: null, }); return this.toResult(`Removed story sc-${subTaskPublicId} from its parent story`); }
- src/tools/stories.ts:280-282 (schema)Zod schema defining the input parameter subTaskPublicId for the stories-remove-subtask tool.{ subTaskPublicId: z.number().positive().describe("The public ID of the sub-task story"), },
- src/tools/stories.ts:277-284 (registration)Registration of the stories-remove-subtask tool using server.addToolWithWriteAccess, linking to the handler and schema.server.addToolWithWriteAccess( "stories-remove-subtask", "Remove a story from its parent. The sub-task will become a regular story.", { subTaskPublicId: z.number().positive().describe("The public ID of the sub-task story"), }, async (params) => await tools.removeSubTaskFromParent(params), );