get_epic_children
Retrieve all child issues and their comments from a JIRA epic to track relationships and analyze project dependencies.
Instructions
Get all child issues in an epic including their comments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| epicKey | Yes | The key of the epic issue |
Implementation Reference
- src/services/jira-api.ts:275-321 (handler)Core handler function that implements the tool logic: searches for issues linked to the epic using JQL, fetches comments for each child issue, cleans and enriches the data with mentions and related issues, and returns the list.
async getEpicChildren(epicKey: string): Promise<CleanJiraIssue[]> { const params = new URLSearchParams({ jql: `"Epic Link" = ${epicKey}`, maxResults: "100", fields: [ "id", "key", "summary", "description", "status", "created", "updated", "parent", "subtasks", "customfield_10014", "issuelinks", ].join(","), expand: "names,renderedFields", }); const data = await this.fetchJson<any>(`/rest/api/3/search?${params}`); const issuesWithComments = await Promise.all( data.issues.map(async (issue: any) => { const commentsData = await this.fetchJson<any>( `/rest/api/3/issue/${issue.key}/comment` ); const cleanedIssue = this.cleanIssue(issue); const comments = commentsData.comments.map((comment: any) => this.cleanComment(comment) ); const commentMentions = comments.flatMap( (comment: CleanComment) => comment.mentions ); cleanedIssue.relatedIssues = [ ...cleanedIssue.relatedIssues, ...commentMentions, ]; cleanedIssue.comments = comments; return cleanedIssue; }) ); return issuesWithComments; } - src/index.ts:100-113 (schema)Input schema definition for the tool, specifying the required 'epicKey' parameter.
name: "get_epic_children", description: "Get all child issues in an epic including their comments", inputSchema: { type: "object", properties: { epicKey: { type: "string", description: "The key of the epic issue", }, }, required: ["epicKey"], additionalProperties: false, }, - src/index.ts:100-113 (registration)Tool registration in the ListTools response, including name, description, and schema.
name: "get_epic_children", description: "Get all child issues in an epic including their comments", inputSchema: { type: "object", properties: { epicKey: { type: "string", description: "The key of the epic issue", }, }, required: ["epicKey"], additionalProperties: false, }, - src/index.ts:287-300 (handler)MCP CallTool request handler case that validates input, calls the Jira API service method, and formats the response as MCP content.
case "get_epic_children": { if (!args.epicKey || typeof args.epicKey !== "string") { throw new McpError( ErrorCode.InvalidParams, "Epic key is required", ); } const response = await this.jiraApi.getEpicChildren(args.epicKey); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; } - src/types/jira.ts:10-42 (schema)Type definition for CleanJiraIssue, which is the structure returned by the tool (array of these). Includes fields like comments, related issues, etc.
export interface CleanJiraIssue { id: string; key: string; summary: string | undefined; status: string | undefined; created: string | undefined; updated: string | undefined; description: string; comments?: CleanComment[]; parent?: { id: string; key: string; summary?: string; }; children?: { id: string; key: string; summary?: string; }[]; epicLink?: { id: string; key: string; summary?: string; }; relatedIssues: { key: string; summary?: string; type: "mention" | "link"; relationship?: string; // For formal issue links e.g. "blocks", "relates to" source: "description" | "comment"; commentId?: string; }[]; }