Skip to main content
Glama
system-info.js•1.34 kB
/** * System Information Tools */ import { formatError, success, failure } from "../utils/jenkins.js"; /** * Get information about the current authenticated user */ 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"); } } /** * Get Jenkins instance status and health information */ export async function getStatus(client) { try { const [overallLoad, queue, nodes] = await Promise.all([ client.get("/overallLoad/api/json"), client.get("/queue/api/json"), client.get("/computer/api/json"), ]); const status = { queueLength: queue.data?.items?.length || 0, totalExecutors: overallLoad.data?.totalExecutors || 0, busyExecutors: overallLoad.data?.busyExecutors || 0, availableExecutors: overallLoad.data?.availableExecutors || 0, nodes: nodes.data?.computer?.map((c) => ({ displayName: c.displayName, offline: c.offline, numExecutors: c.numExecutors, })) || [], }; return success("getStatus", { status }); } catch (error) { return formatError(error, "get status"); } }

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