jenkins_list_plugins
List installed Jenkins plugins and their properties including version, active status, enabled, pinned, and whether updates are available.
Instructions
List installed Jenkins plugins visible through pluginManager/api/json.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree | No | plugins[shortName,longName,version,active,enabled,pinned,hasUpdate,deleted] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/jenkins_mcp_server/tools.py:202-207 (handler)The tool handler function for jenkins_list_plugins. Calls Jenkins pluginManager API with an optional tree parameter to filter plugin fields.
@mcp.tool() def jenkins_list_plugins( tree: str = "plugins[shortName,longName,version,active,enabled,pinned,hasUpdate,deleted]", ) -> dict[str, Any]: """List installed Jenkins plugins visible through pluginManager/api/json.""" return _run(lambda: _get_json("pluginManager", params={"tree": tree})) - src/jenkins_mcp_server/tools.py:369-369 (registration)Registration entry in READ_ONLY_TOOLS list, marking this tool as read-only.
"jenkins_list_plugins", - Helper function _get_json that creates a JenkinsClient and calls get_json on it.
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 sends a GET request and parses JSON response. It appends '/api/json' to the path.
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 - Appends '/api/json' to a Jenkins API path if not already present.
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, ""))