get_current_user
Retrieve the profile of the user associated with the current API key to verify identity and access permissions in MantisBT bug tracking.
Instructions
Retrieve the profile of the user associated with the current API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/users.ts:20-44 (registration)The 'get_current_user' tool is registered and implemented directly within the registerUserTools function in src/tools/users.ts. The handler logic performs an API call to 'users/me' using the MantisClient.
server.registerTool( 'get_current_user', { title: 'Get Current User', description: 'Retrieve the profile of the user associated with the current API key.', inputSchema: z.object({}), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, async () => { try { const result = await client.get<MantisUser>('users/me'); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } ); }