Get Current User
get_current_userRetrieve the profile of the user associated with the current API key in MantisBT bug tracker.
Instructions
Retrieve the profile of the user associated with the current API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/users.ts:32-42 (handler)The handler function for the 'get_current_user' tool, which calls the MantisClient to retrieve the user's profile.
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 }; } } - src/tools/users.ts:20-43 (registration)Registration of the 'get_current_user' tool within the MCP server.
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 }; } } );