get_my_work_summary
Retrieve a summary of your Jira issues updated, commented on, or transitioned within a specified date range to track work activity.
Instructions
Get a summary of issues the CURRENT_USER has worked on (updated, commented, or transitioned) within a date range
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | Yes | Start date in YYYY-MM-DD format | |
| endDate | Yes | End date in YYYY-MM-DD format |
Implementation Reference
- src/index.ts:194-219 (handler)MCP tool handler: validates date inputs, fetches work summary via getWorkSummary helper, formats JSON output, handles errors with structured response.async ({ startDate, endDate }) => { try { // Validate date format const dateRegex = /^\d{4}-\d{2}-\d{2}$/; if (!dateRegex.test(startDate)) { throw new Error('startDate must be in YYYY-MM-DD format'); } if (!dateRegex.test(endDate)) { throw new Error('endDate must be in YYYY-MM-DD format'); } const issues = await getWorkSummary(CURRENT_USER, startDate, endDate); const output = { issues }; return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } catch (error) { const output = formatError(error); return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, isError: true, }; } }
- src/index.ts:173-193 (schema)Input schema requires startDate/endDate strings; output schema defines issues array or error object using Zod.{ title: 'Get My Work Summary', description: 'Get a summary of issues the CURRENT_USER has worked on (updated, commented, or transitioned) within a date range', inputSchema: { startDate: z.string().describe('Start date in YYYY-MM-DD format'), endDate: z.string().describe('End date in YYYY-MM-DD format'), }, outputSchema: { issues: z.array(z.object({ key: z.string(), summary: z.string(), status: z.string(), lastActivityType: z.string(), })).optional(), error: z.object({ message: z.string(), statusCode: z.number().optional(), details: z.unknown().optional(), }).optional(), }, },
- src/index.ts:171-220 (registration)Full registration of get_my_work_summary tool with MCP server including name, schema, and handler function.server.registerTool( 'get_my_work_summary', { title: 'Get My Work Summary', description: 'Get a summary of issues the CURRENT_USER has worked on (updated, commented, or transitioned) within a date range', inputSchema: { startDate: z.string().describe('Start date in YYYY-MM-DD format'), endDate: z.string().describe('End date in YYYY-MM-DD format'), }, outputSchema: { issues: z.array(z.object({ key: z.string(), summary: z.string(), status: z.string(), lastActivityType: z.string(), })).optional(), error: z.object({ message: z.string(), statusCode: z.number().optional(), details: z.unknown().optional(), }).optional(), }, }, async ({ startDate, endDate }) => { try { // Validate date format const dateRegex = /^\d{4}-\d{2}-\d{2}$/; if (!dateRegex.test(startDate)) { throw new Error('startDate must be in YYYY-MM-DD format'); } if (!dateRegex.test(endDate)) { throw new Error('endDate must be in YYYY-MM-DD format'); } const issues = await getWorkSummary(CURRENT_USER, startDate, endDate); const output = { issues }; return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } catch (error) { const output = formatError(error); return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, isError: true, }; } } );
- src/jira-client.ts:562-578 (helper)Helper function implementing core logic: builds JQL for user activity in date range, searches issues, maps to summary format.export async function getWorkSummary( username: string, startDate: string, endDate: string ): Promise<WorkSummaryItem[]> { // JQL to find issues where the user was involved (assignee, reporter, commenter, or updated) const jql = `(assignee = "${username}" OR reporter = "${username}" OR "comment author" = "${username}") AND updated >= "${startDate}" AND updated <= "${endDate}" ORDER BY updated DESC`; const issues = await searchIssues(jql, ['summary', 'status', 'priority', 'updated']); return issues.map((issue) => ({ key: issue.key, summary: issue.summary, status: issue.status, lastActivityType: 'updated', // Simplified - could be enhanced with changelog API })); }
- src/jira-client.ts:88-93 (schema)TypeScript interface defining the structure of work summary items returned by getWorkSummary.export interface WorkSummaryItem { key: string; summary: string; status: string; lastActivityType: string; }