Skip to main content
Glama
mdtahmidhossain

jenkins-http-mcp-server

jenkins_whoami

Retrieve the authenticated Jenkins user identity by querying the whoAmI API endpoint. Returns details about the current session.

Instructions

Return the authenticated Jenkins identity from /whoAmI/api/json.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool 'jenkins_whoami' is registered as an MCP tool via the @mcp.tool() decorator inside register_tools().
    def register_tools(mcp: FastMCP) -> None:
        @mcp.tool()
        def jenkins_whoami() -> dict[str, Any]:
            """Return the authenticated Jenkins identity from /whoAmI/api/json."""
            return _run(lambda: _get_json("whoAmI"))
  • The handler function for the 'jenkins_whoami' tool. It calls _get_json('whoAmI') which hits the Jenkins /whoAmI/api/json endpoint to return the authenticated identity.
    def jenkins_whoami() -> dict[str, Any]:
        """Return the authenticated Jenkins identity from /whoAmI/api/json."""
        return _run(lambda: _get_json("whoAmI"))
  • Helper function _get_json creates a client via _client() and calls client.get_json(), used by the jenkins_whoami handler.
    def _get_json(path: str, params: dict[str, Any] | None = None) -> Any:
        with _client() as client:
            return client.get_json(path, params=params)
  • JenkinsClient.get_json() performs the actual HTTP GET request with /api/json appended, and returns the parsed JSON response.
    def get_json(self, path: str, params: Mapping[str, Any] | None = None) -> Json:
        response = self.request("GET", append_api_json(path), params=params)
        try:
            payload = response.json()
        except json.JSONDecodeError as exc:
            raise JenkinsHTTPError(
                response.status_code,
                "GET",
                normalize_relative_path(path),
                "Response was not JSON",
                _body_snippet(response),
            ) from exc
        return payload
  • append_api_json() ensures the path ends with /api/json (e.g., 'whoAmI' -> 'whoAmI/api/json').
    def append_api_json(path: str) -> str:
        path = normalize_relative_path(path)
        split = urlsplit(path)
        clean = split.path.rstrip("/")
        if not clean.endswith("/api/json") and clean != "api/json":
            clean = f"{clean}/api/json"
        return urlunsplit(("", "", clean, split.query, ""))
Behavior2/5

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

No annotations are provided, so the description bears the full burden. It does not disclose whether the operation is read-only, requires specific permissions, or any side effects. Stating it returns identity from /whoAmI suggests a safe GET, but such behavioral traits are not explicitly communicated.

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?

Single, front-loaded sentence with no extraneous words. Efficiently communicates the action and resource.

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

Completeness4/5

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

For a zero-parameter tool with an output schema, the description is largely complete. It identifies the endpoint and purpose. However, it could mention the return type (user identity details) but is sufficient given the output schema.

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?

The input schema has no parameters and 100% schema description coverage. The description adds no parameter information because there are none. With 0 parameters, the baseline is 4, and the description does not detract.

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

Purpose5/5

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

The description explicitly states the verb 'Return' and the resource 'authenticated Jenkins identity', directly from the endpoint '/whoAmI/api/json'. It clearly distinguishes from sibling tools like jenkins_list_jobs or jenkins_get_json, which serve different purposes.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. It implies usage for checking current authentication identity, but lacks when-not-to-use or alternative suggestions. Coverage is minimal.

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/mdtahmidhossain/jenkins-http-mcp-server'

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