assign-current-user-as-owner
Assign yourself as the owner of a Shortcut story to take responsibility for its completion and management.
Instructions
Assign the current user as the owner of a story
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storyPublicId | Yes | The public ID of the story |
Implementation Reference
- src/tools/stories.ts:325-343 (handler)The handler function that executes the tool's core logic: fetches the story and current user, checks if the user is already an owner, and updates the story's owner_ids by appending the current user's ID.async assignCurrentUserAsOwner(storyPublicId: number) { const story = await this.client.getStory(storyPublicId); if (!story) throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`); const currentUser = await this.client.getCurrentUser(); if (!currentUser) throw new Error("Failed to retrieve current user"); if (story.owner_ids.includes(currentUser.id)) return this.toResult(`Current user is already an owner of story sc-${storyPublicId}`); await this.client.updateStory(storyPublicId, { owner_ids: story.owner_ids.concat([currentUser.id]), }); return this.toResult(`Assigned current user as owner of story sc-${storyPublicId}`); }
- src/tools/stories.ts:209-210 (schema)Zod input schema defining the required storyPublicId parameter.storyPublicId: z.number().positive().describe("The public ID of the story"), },
- src/tools/stories.ts:205-212 (registration)Registers the tool with the MCP server, providing the tool name, description, input schema, and handler reference.server.tool( "assign-current-user-as-owner", "Assign the current user as the owner of a story", { storyPublicId: z.number().positive().describe("The public ID of the story"), }, async ({ storyPublicId }) => await tools.assignCurrentUserAsOwner(storyPublicId), );