Skip to main content
Glama

get_team_activity

Track recent team activity in Jira by retrieving issue updates, status changes, comments, and assignments within a specified timeframe.

Instructions

Get recent issue updates (status changes, comments, assignments) from TEAM_MEMBERS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeframeDaysNoNumber of days to look back (default: 7)

Implementation Reference

  • Core handler function that executes the tool logic: queries Jira API using JQL to find recent updates on issues assigned to or reported by team members within the given timeframe, maps results to activity items.
    export async function getTeamActivity( teamMembers: string[], timeframeDays: number = 7 ): Promise<JiraActivityItem[]> { const startDate = new Date(); startDate.setDate(startDate.getDate() - timeframeDays); const startDateStr = startDate.toISOString().split('T')[0]; // Build JQL for team member activity const membersList = teamMembers.map((m) => `"${m}"`).join(', '); const jql = `(assignee IN (${membersList}) OR reporter IN (${membersList})) AND updated >= "${startDateStr}" ORDER BY updated DESC`; const params = new URLSearchParams({ jql, maxResults: '50', }); // Add fields as separate params for the new API ['summary', 'status', 'assignee', 'updated'].forEach(f => params.append('fields', f)); const response = await jiraFetch<{ issues: Array<{ key: string; id: string; fields: { summary: string; status: { name: string }; assignee?: { displayName: string; accountId: string }; updated: string; }; }>; isLast?: boolean; nextPageToken?: string; }>(`/search/jql?${params.toString()}`); return response.issues.map((issue) => ({ issueKey: issue.key, teamMember: issue.fields.assignee?.displayName || 'Unassigned', activityType: 'issue_updated', timestamp: issue.fields.updated, summary: issue.fields.summary, })); }
  • src/index.ts:226-275 (registration)
    MCP tool registration including input/output schemas, description, and wrapper handler that calls the core getTeamActivity function.
    server.registerTool( 'get_team_activity', { title: 'Get Team Activity', description: 'Get recent issue updates (status changes, comments, assignments) from TEAM_MEMBERS', inputSchema: { timeframeDays: z.number().optional().describe('Number of days to look back (default: 7)'), }, outputSchema: { activities: z.array(z.object({ issueKey: z.string(), teamMember: z.string(), activityType: z.string(), timestamp: z.string(), summary: z.string().optional(), })).optional(), error: z.object({ message: z.string(), statusCode: z.number().optional(), details: z.unknown().optional(), }).optional(), }, }, async ({ timeframeDays }) => { try { if (TEAM_MEMBERS.length === 0) { throw new Error('TEAM_MEMBERS is not configured. Please add team member usernames or accountIds.'); } const days = timeframeDays ?? 7; if (days < 1 || days > 365) { throw new Error('timeframeDays must be between 1 and 365'); } const activities = await getTeamActivity(TEAM_MEMBERS, days); const output = { activities }; 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, }; } } );
  • TypeScript interface defining the structure of activity items returned by the tool.
    export interface JiraActivityItem { issueKey: string; teamMember: string; activityType: string; timestamp: string; summary?: string; }
  • Configuration constant for team members used by the get_team_activity tool.
    const TEAM_MEMBERS: string[] = process.env.JIRA_TEAM_MEMBERS ? process.env.JIRA_TEAM_MEMBERS.split(',').map(m => m.trim()) : [];

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