get-epic
Retrieve Shortcut epic details using the epic's public ID to access project information and track development progress.
Instructions
Get a Shortcut epic by public ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epicPublicId | Yes | The public ID of the epic to get |
Input Schema (JSON Schema)
{
"properties": {
"epicPublicId": {
"description": "The public ID of the epic to get",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"epicPublicId"
],
"type": "object"
}
Implementation Reference
- src/tools/epics.ts:93-102 (handler)Core handler logic for 'get-epic': fetches epic by ID, handles missing epic, formats output with related entities using base helpers.async getEpic(epicPublicId: number) { const epic = await this.client.getEpic(epicPublicId); if (!epic) throw new Error(`Failed to retrieve Shortcut epic with public ID: ${epicPublicId}`); return this.toResult( `Epic: ${epicPublicId}`, await this.entityWithRelatedEntities(epic, "epic"), ); }
- src/tools/epics.ts:13-18 (registration)Registers the 'get-epic' tool with MCP server, including description, input schema, and reference to handler.server.tool( "get-epic", "Get a Shortcut epic by public ID", { epicPublicId: z.number().positive().describe("The public ID of the epic to get") }, async ({ epicPublicId }) => await tools.getEpic(epicPublicId), );
- src/tools/epics.ts:16-16 (schema)Input schema using Zod: requires positive integer epicPublicId.{ epicPublicId: z.number().positive().describe("The public ID of the epic to get") },
- src/tools/base.ts:462-471 (helper)BaseTools helper to create standardized MCP tool result with text message and optional JSON data.protected toResult(message: string, data?: unknown): CallToolResult { return { content: [ { type: "text", text: `${message}${data !== undefined ? `\n\n${JSON.stringify(data, null, 2)}` : ""}`, }, ], }; }
- src/tools/base.ts:415-435 (helper)BaseTools helper to augment epic entity with related entities (users, teams, workflows, objectives) and standardize property names.protected async entityWithRelatedEntities( entity: | Story | StorySearchResult | StorySlim | Epic | EpicSearchResult | Iteration | IterationSlim | Group | Workflow | ObjectiveSearchResult | Milestone, entityType = "entity", ) { const relatedEntities = await this.getRelatedEntities(entity); return { [entityType]: this.renameEntityProps(entity as unknown as Record<string, unknown>), relatedEntities, }; }