Skip to main content
Glama

get_my_work_summary

Retrieve a summary of your Jira work activity by specifying a date range to view issues you updated, commented on, or transitioned.

Instructions

Get a summary of issues the CURRENT_USER has worked on (updated, commented, or transitioned) within a date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format

Implementation Reference

  • src/index.ts:171-219 (registration)
    Registration of the 'get_my_work_summary' MCP tool using server.registerTool(). Includes title, description, inputSchema (startDate/endDate), outputSchema (issues or error), and the 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,
          };
        }
      }
  • Input and output schemas using Zod for validating tool parameters and response structure.
    {
      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(),
      },
    },
  • Inline MCP tool handler: validates date formats, calls getWorkSummary helper, formats output or error 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,
        };
      }
  • Core logic helper: constructs JQL for user's issues (assignee/reporter/commenter) updated in date range, searches issues, and maps to output 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
      }));
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eh24905-wiz/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server