Get User
get_userRetrieve profile details for any Codebeamer user by providing their numeric user ID.
Instructions
Get profile details for a Codebeamer user by their numeric ID. User IDs appear in item fields like assignedTo and createdBy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | Numeric user ID |
Implementation Reference
- src/tools/users.ts:21-24 (handler)The async handler function that executes the 'get_user' tool logic. It calls client.getUser(userId) and formats the result.
async ({ userId }) => { const user = await client.getUser(userId); return { content: [{ type: "text", text: formatUser(user) }] }; }, - src/tools/users.ts:17-19 (schema)Input schema for the 'get_user' tool, defined with zod: userId is a positive integer.
inputSchema: { userId: z.number().int().positive().describe("Numeric user ID"), }, - src/tools/users.ts:10-25 (registration)Registration of the 'get_user' tool via server.registerTool with title, description, inputSchema, and handler.
server.registerTool( "get_user", { title: "Get User", description: "Get profile details for a Codebeamer user by their numeric ID. " + "User IDs appear in item fields like assignedTo and createdBy.", inputSchema: { userId: z.number().int().positive().describe("Numeric user ID"), }, }, async ({ userId }) => { const user = await client.getUser(userId); return { content: [{ type: "text", text: formatUser(user) }] }; }, ); - Client method getUser(id) that makes an HTTP GET request to /users/{id}.
getUser(id: number): Promise<CbUser> { return this.http.get(`/users/${id}`, { resource: `user ${id}` }); } - The CbUser interface type definition specifying the structure of a user object.
export interface CbUser { id: number; name: string; firstName?: string; lastName?: string; email?: string; status?: string; registryDate?: string; }