Skip to main content
Glama

jira_get_current_user

Retrieve current user profile details and permissions from the JIRA MCP Server to manage access and streamline workflow integration within Cursor IDE.

Instructions

Get current user profile information and permissions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • GetCurrentUserHandler class: the core tool handler that executes the logic to retrieve and format the current user's profile from JIRA using the injected use case.
    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.", ); } }
  • Tool configuration definition for 'jira_get_current_user', including name, description, empty params schema, and handler binding for MCP registration.
    export function createUserToolsConfig(tools: { jira_get_current_user: ToolHandler; }): ToolConfig[] { return [ { 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), }, ]; }
  • Factory function that instantiates GetCurrentUserHandler and wraps it in the tools.jira_get_current_user object with handle method.
    function createUserHandlers(dependencies: JiraDependencies) { const getCurrentUserHandler = new GetCurrentUserHandler( dependencies.getCurrentUserUseCase, ); return { jira_get_current_user: { handle: async (args: unknown) => getCurrentUserHandler.handle(args), }, }; }
  • Includes the user tools config (containing jira_get_current_user) in the tool configuration groups for registration with the MCP server.
    { groupName: "users", configs: createUserToolsConfig({ jira_get_current_user: tools.jira_get_current_user, }), },
  • TypeScript interface definition for the jira_get_current_user tool handler in the JiraTools interface.
    jira_get_current_user: ToolHandler; }

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/Dsazz/mcp-jira'

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