Skip to main content
Glama

whoAmI

Retrieve details about the currently authenticated Jenkins user, including identity and permissions, to verify access and configure automation workflows.

Instructions

Get information about the current authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the whoAmI tool logic. It makes an API call to /whoAmI/api/json to retrieve current user information and returns a standardized success or failure response.
    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");
    	}
    }
  • Registration of the whoAmI tool in the central toolRegistry. Includes name, description, empty input schema (no parameters required), and reference to the handler function.
    whoAmI: {
    	name: "whoAmI",
    	description: "Get information about the current authenticated user",
    	inputSchema: {
    		type: "object",
    		properties: {},
    	},
    	handler: whoAmI,
    },
  • Input schema for the whoAmI tool, defining an empty object (no input parameters required).
    inputSchema: {
    	type: "object",
    	properties: {},
    },
  • Helper function formatError used in the whoAmI handler to standardize error responses.
    export function formatError(error, operation) {
    	const status = error.response?.status;
    	const errorInfo = {
    		success: false,
    		operation,
    		message: error.message,
    		statusCode: status,
    		code: error.code,
    	};
    
    	if (status === 403) {
    		errorInfo.authError = true;
    		errorInfo.message =
    			"Permission denied - check job permissions or CSRF settings";
    	} else if (status === 401) {
    		errorInfo.authError = true;
    		errorInfo.message =
    			"Authentication failed - check username and API token";
    	} else if (status === 404) {
    		errorInfo.message = `Resource not found during ${operation}`;
    	}
    
    	if (error.response?.data && typeof error.response.data === "object") {
    		errorInfo.responseData = error.response.data;
    	}
    
    	return errorInfo;
    }
  • Helper function success used to wrap successful responses in whoAmI.
    export function success(operation, data = {}) {
    	return { success: true, operation, ...data };
    }
  • Helper function failure used to wrap failure responses in whoAmI.
    export function failure(operation, message, meta = {}) {
    	return { success: false, operation, message, ...meta };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. While 'Get information' implies a read operation, it doesn't disclose authentication requirements, rate limits, error conditions, or what specific user information is returned. For an authentication-focused tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an authentication/identity tool with no annotations and no output schema, the description is insufficient. It doesn't explain what user information is returned (permissions, roles, identifiers), authentication prerequisites, or how this differs from Jenkins' standard user management tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and the empty input schema is self-explanatory for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get information') and target ('about the current authenticated user'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools (all Jenkins-related build/job tools), which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools focused on builds, jobs, and queue operations, there's no indication of when authentication status checking is appropriate versus other operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/umishra1504/Jenkins-mcp-server'

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