get_current_user
Retrieve information about the current authenticated user in Jira, including account details and roles.
Instructions
Get information about the current authenticated user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/assignments.ts:104-126 (handler)Handler function for the 'get_current_user' tool. Calls jiraClient.getCurrentUser() and returns essential user fields (accountId, displayName, emailAddress, active, timeZone, accountType).
case 'get_current_user': { const user = await jiraClient.getCurrentUser(); // Extract essential fields, improve syntax const userData = user; const essentialUser = { id: userData.accountId, // Shorter field name name: userData.displayName, // Shorter field name email: userData.emailAddress, // Shorter field name active: userData.active, timezone: userData.timeZone, // Shorter field name type: userData.accountType // Shorter field name }; return { content: [ { type: 'text', text: JSON.stringify(essentialUser, null, 2), }, ], }; } - src/tools/assignments.ts:51-58 (schema)Tool definition/schema for 'get_current_user'. Defines name, description, and an empty inputSchema (no parameters needed).
{ name: 'get_current_user', description: 'Get information about the current authenticated user', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:90-95 (registration)Registration/routing in the MCP server: routes 'get_current_user' to handleAssignmentTool.
} else if ( name.startsWith('assign_issue') || name.startsWith('get_users') || name.startsWith('get_current_user') ) { return await handleAssignmentTool(name, args || {}, this.jiraClient); - src/jira-client.ts:430-438 (helper)Helper method in JiraClient that calls the underlying Jira API (jira.myself.getCurrentUser()) to fetch current user data.
// Get current user information async getCurrentUser() { try { const response = await this.jira.myself.getCurrentUser(); return response; } catch (error) { throw new Error(`Failed to get current user: ${error instanceof Error ? error.message : 'Unknown error'}`); } }