get_plugin
Retrieve details of a Jenkins plugin by its short name, including dependencies when depth is set to 2 or higher.
Instructions
Get a specific plugin from Jenkins
Contains detailed information about the plugin, including dependencies when depth >= 2.
Args: short_name: The short name of the plugin depth: The depth of the information to retrieve. Default is 2 (includes dependencies).
Returns: The plugin details, or None if not found
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_name | Yes | ||
| depth | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_jenkins/server/plugin.py:20-33 (handler)The MCP tool handler that implements 'get_plugin'. It is decorated with @mcp.tool(tags={'read'}) and calls the REST client's get_plugin method.
@mcp.tool(tags={'read'}) async def get_plugin(ctx: Context, short_name: str, depth: int = 2) -> dict | None: """Get a specific plugin from Jenkins Contains detailed information about the plugin, including dependencies when depth >= 2. Args: short_name: The short name of the plugin depth: The depth of the information to retrieve. Default is 2 (includes dependencies). Returns: The plugin details, or None if not found """ return jenkins(ctx).get_plugin(short_name=short_name, depth=depth) - The REST client helper method that fetches all plugins and filters by short_name to find the specific plugin.
def get_plugin(self, *, short_name: str, depth: int = 2) -> dict | None: """Get a specific plugin by short name. Args: short_name: The short name of the plugin. depth: The depth of the information to retrieve. Default is 2 (includes dependencies). Returns: A list of plugins that can be downgraded. """ plugins = self.get_plugins(depth=depth) for plugin in plugins: if plugin.get('shortName') == short_name: return plugin return None - src/mcp_jenkins/server/__init__.py:30-34 (registration)The MCP server instance and tool registration mechanism. plugin.py is imported here so the @mcp.tool() decorators register get_plugin (and all other plugin tools) with the FastMCP server.
mcp = JenkinsMCP('mcp-jenkins', lifespan=lifespan) # Import tool modules to register them with the MCP server # This must happen after mcp is created so the @mcp.tool() decorators can reference it from mcp_jenkins.server import build, item, node, plugin, queue, view # noqa: F401, E402