Skip to main content
Glama

get_all_plugins

Retrieve all installed Jenkins plugins along with their dependency information. Use the depth parameter to control the detail level.

Instructions

Get all installed plugins from Jenkins

Args: depth: The depth of the information to retrieve. Default is 2 (includes dependencies).

Returns: A list of all installed plugins

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_all_plugins'. Decorated with @mcp.tool(tags={'read'}), calls jenkins(ctx).get_plugins(depth=depth).
    @mcp.tool(tags={'read'})
    async def get_all_plugins(ctx: Context, depth: int = 2) -> list[dict]:
        """Get all installed plugins from Jenkins
    
        Args:
            depth: The depth of the information to retrieve. Default is 2 (includes dependencies).
    
        Returns:
            A list of all installed plugins
        """
        return jenkins(ctx).get_plugins(depth=depth)
  • Jenkins client method get_plugins that performs the actual HTTP request to the Jenkins REST API. Calls PLUGIN_LIST endpoint with specified depth.
    def get_plugins(self, *, depth: int = 0) -> list[dict]:
        """Get a list of all installed plugins.
    
        Args:
            depth: The depth of the information to retrieve.
    
        Returns:
            A list of plugin dictionaries.
        """
        response = self.request('GET', rest_endpoint.PLUGIN_LIST(depth=depth))
        return response.json().get('plugins', [])
  • REST endpoint definition: PLUGIN_LIST = RestEndpoint('pluginManager/api/json?depth={depth}').
    PLUGIN_LIST = RestEndpoint('pluginManager/api/json?depth={depth}')
  • Registration of the mcp server instance (JenkinsMCP) and import of plugin.py which triggers the @mcp.tool decorators.
    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
  • The 'jenkins()' helper function that creates/configures a Jenkins client instance from context, used by the handler.
    def jenkins(ctx: Context) -> Jenkins:
        if ctx.request_context.lifespan_context.jenkins_session_singleton and getattr(ctx.session, 'jenkins', None):
            return ctx.session.jenkins
    
        jenkins_url = ctx.request_context.lifespan_context.jenkins_url
        jenkins_username = ctx.request_context.lifespan_context.jenkins_username
        jenkins_password = ctx.request_context.lifespan_context.jenkins_password
    
        jenkins_timeout = ctx.request_context.lifespan_context.jenkins_timeout
        jenkins_verify_ssl = ctx.request_context.lifespan_context.jenkins_verify_ssl
    
        try:
            requests = get_http_request()
    
            jenkins_url = getattr(requests.state, 'jenkins_url', None) or jenkins_url
            jenkins_username = getattr(requests.state, 'jenkins_username', None) or jenkins_username
            jenkins_password = getattr(requests.state, 'jenkins_password', None) or jenkins_password
    
            logger.debug(f'Retrieved Jenkins auth from request state - url: {jenkins_url}, username: {jenkins_username}')
        except RuntimeError as e:
            logger.debug(f'No HTTP request context available, falling back to environment variables: {e}')
        except Exception as e:  # noqa: BLE001
            logger.error(
                f'Unexpected error retrieving Jenkins auth from request, falling back to environment variables: {e}'
            )
    
        if not all((jenkins_url, jenkins_username, jenkins_password)):
            msg = (
                'Jenkins authentication details are missing. '
                'Please provide them via x-jenkins-* headers '
                'or CLI arguments (--jenkins-url, --jenkins-username, --jenkins-password).'
            )
            raise ValueError(msg)
    
        logger.info(
            f'Creating Jenkins client with url: '
            f'{jenkins_url}, username: {jenkins_username}, timeout: {jenkins_timeout}, verify_ssl: {jenkins_verify_ssl}'
        )
    
        ctx.session.jenkins = Jenkins(
            url=jenkins_url,
            username=jenkins_username,
            password=jenkins_password,
            timeout=jenkins_timeout,
            verify_ssl=jenkins_verify_ssl,
        )
    
        return ctx.session.jenkins
Behavior3/5

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

Annotations are absent, so the description carries the transparency burden. It explains the depth parameter and return type, but does not disclose safety (read-only) or side effects. Depth explanation adds some value.

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?

Description is concise with only 4 lines, front-loads the main purpose, and uses structured Args/Returns format. No wasted words.

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?

With a single optional parameter and an existing output schema, the description adequately explains return type and parameter effect. Could mention no filtering, but overall complete.

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

Parameters5/5

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

The schema has 0% description coverage, so the description must compensate. It explains the depth parameter meaning and default behavior (includes dependencies), adding significant value beyond type and default.

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 clearly states the verb 'Get', the resource 'all installed plugins', and the context 'from Jenkins'. It distinguishes from sibling tools like get_plugin (single) and get_plugins_with_updates (filtered).

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?

No guidance on when to use this tool vs alternatives like get_plugins_with_updates. The description mentions depth but does not provide usage context or exclusions.

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/lanbaoshen/mcp-jenkins'

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