jira_get_current_user
Retrieve your current JIRA user profile and permissions to verify access rights and configure integrations within the Cursor IDE.
Instructions
Get current user profile information and permissions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- GetCurrentUserHandler class that implements the core execution logic for the jira_get_current_user tool. Calls the use case to fetch user data and formats the response using UserProfileFormatter.
export class GetCurrentUserHandler extends BaseToolHandler< Record<string, never>, string > { private formatter: UserProfileFormatter; /** * Create a new GetCurrentUserHandler with use case * * @param getCurrentUserUseCase - Use case for retrieving current user profile */ constructor(private readonly getCurrentUserUseCase: GetCurrentUserUseCase) { super("JIRA", "Get Current User"); this.formatter = new UserProfileFormatter(); } /** * Execute the handler logic * Retrieves current user profile and formats it */ protected async execute(): Promise<string> { try { this.logger.info("Getting current user profile"); // Get current user using use case const response = await this.getCurrentUserUseCase.execute(); // Format user profile using the formatter return this.formatter.format(response.user); } catch (error) { this.logger.error(`Failed to get current user: ${error}`); throw this.enhanceError(error); } } /** * Enhance error messages for better user guidance */ private enhanceError(error: unknown): Error { if (error instanceof JiraPermissionError) { return new Error( "❌ **Permission Denied**\n\nYou don't have permission to access user profile information.\n\n**Solutions:**\n- Check your JIRA authentication\n- Verify your API token is valid\n- Contact your JIRA administrator\n\n**Required Permissions:** Valid JIRA authentication", ); } if (error instanceof JiraApiError) { return new Error( `❌ **JIRA API Error**\n\n${error.message}\n\n**Solutions:**\n- Check your JIRA connection\n- Verify your authentication credentials\n- Try again in a few moments\n\n**Example:** \`jira_get_current_user\``, ); } if (error instanceof Error) { return new Error( `❌ **User Profile Retrieval Failed**\n\n${error.message}\n\n**Solutions:**\n- Check your JIRA connection\n- Verify your authentication\n- Try again in a few moments\n\n**Example:** \`jira_get_current_user\``, ); } return new Error( "❌ **Unknown Error**\n\nAn unknown error occurred during user profile retrieval.\n\nPlease check your connection and try again.", ); } } - Factory function creates the jira_get_current_user tool handler object by wrapping the GetCurrentUserHandler's handle method.
return { jira_get_current_user: { handle: async (args: unknown) => getCurrentUserHandler.handle(args), }, }; - src/features/jira/tools/configs/user-tools.config.ts:18-23 (registration)ToolConfig object defining the name, description, input schema (empty params), and handler binding for registration.
{ name: "jira_get_current_user", description: "Get current user profile information and permissions", params: {}, handler: tools.jira_get_current_user.handle.bind(tools.jira_get_current_user), }, - src/features/jira/tools/registry/tool.registry.ts:104-106 (registration)Configuration group for user tools passed to registry, which calls server.tool() to register with MCP server.
configs: createUserToolsConfig({ jira_get_current_user: tools.jira_get_current_user, }), - TypeScript interface definition for the jira_get_current_user tool handler in JiraTools interface.
jira_get_current_user: ToolHandler; }