Skip to main content
Glama

get_item_parameters

Get parameter definitions of a Jenkins job: name, type, defaultValue, and description. Provide the job's fullname to receive the list.

Instructions

Get the parameter definitions of a Jenkins job

Args: fullname: The fullname of the item

Returns: A list of parameter definitions, each containing name, type, defaultValue, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullnameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler function for the 'get_item_parameters' tool. It fetches the Jenkins job config XML, parses it with ElementTree, and extracts parameter definitions (name, type, defaultValue, description).
    @mcp.tool(tags=['read'])
    async def get_item_parameters(ctx: Context, fullname: str) -> list[dict]:
        """Get the parameter definitions of a Jenkins job
    
        Args:
            fullname: The fullname of the item
    
        Returns:
            A list of parameter definitions, each containing name, type, defaultValue, and description
        """
        config_xml = jenkins(ctx).get_item_config(fullname=fullname)
        root = ET.fromstring(config_xml)
    
        params = []
        for param in root.iter('parameterDefinitions'):
            for definition in param:
                entry = {
                    'name': definition.findtext('name', ''),
                    'type': definition.tag,
                    'defaultValue': definition.findtext('defaultValue', ''),
                    'description': definition.findtext('description', ''),
                }
                params.append(entry)
    
        return params
  • The tool registration mechanism: 'from mcp_jenkins.server import mcp' imports the FastMCP instance, and the '@mcp.tool(tags=['read'])' decorator registers the function as an MCP tool.
    from mcp_jenkins.server import mcp
  • The MCP server instance initialization and tool module imports. The 'mcp' object is created, then the 'item' module is imported (line 34), which triggers @mcp.tool decorators to register all tools including get_item_parameters.
    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 helper function 'get_item_config' in the Jenkins REST client. It gets the XML configuration of a Jenkins item by fullname, which get_item_parameters calls to retrieve the job config XML.
    def get_item_config(self, *, fullname: str) -> str:
        """Get item configuration by its fullname.
    
        Args:
            fullname: The full name of the item (e.g., "folder1/folder2/item").
    
        Returns:
            The item configuration as an XML string.
        """
        folder, name = self._parse_fullname(fullname)
        response = self.request('GET', rest_endpoint.ITEM_CONFIG(folder=folder, name=name))
        return response.text
Behavior3/5

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

No annotations provided, so description must cover behavior. It describes the return format (list of parameter definitions with fields), which adds value, but does not explicitly state that it is read-only, requires permissions, or what happens on error. Given it's a simple getter, this is adequate but not thorough.

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?

The description is extremely concise: one line for purpose, then structured Args/Returns sections. No unnecessary words, all sentences earn their place.

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

Completeness3/5

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

Given the tool's simplicity (1 parameter, output described), the description covers the essential purpose, input, and output. However, it lacks error handling, permission requirements, or usage context compared to siblings. It is minimally complete.

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

Parameters3/5

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

The description adds a brief explanation for the 'fullname' parameter: 'The fullname of the item'. Since the schema has 0% description coverage, this compensates somewhat. However, it does not elaborate on the format or examples of valid fullnames.

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 'Get the parameter definitions of a Jenkins job', which specifies the action (get) and resource (parameter definitions of a job). This distinguishes it from siblings like 'get_item' (the job itself) and 'get_build_parameters' (build-level parameters).

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 versus alternatives. It does not mention prerequisites, typical scenarios, or comparisons to sibling tools like 'get_item_config' or 'get_build_parameters'.

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