whoAmI
Retrieve details about the currently authenticated Jenkins user, including identity and access permissions, for verification and access control purposes.
Instructions
Get information about the current authenticated user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system-info.js:10-22 (handler)The handler function that implements the whoAmI tool logic: fetches current user info from Jenkins /whoAmI/api/json endpoint using the provided client, handles success/error responses using shared utilities.export async function whoAmI(client) { try { const response = await client.get("/whoAmI/api/json"); if (response.status === 200) { return success("whoAmI", { user: response.data }); } return failure("whoAmI", "Failed to get user info", { statusCode: response.status, }); } catch (error) { return formatError(error, "get user info"); } }
- src/tools/index.js:195-203 (registration)Tool registration entry in the central toolRegistry object, defining name, description, input schema (no required parameters), and references the imported handler function.whoAmI: { name: "whoAmI", description: "Get information about the current authenticated user", inputSchema: { type: "object", properties: {}, }, handler: whoAmI, },
- src/tools/index.js:198-201 (schema)Input schema definition for the whoAmI tool: accepts an empty object (no parameters required).inputSchema: { type: "object", properties: {}, },