Skip to main content
Glama

run_groovy_script

Execute Groovy scripts on Jenkins to access internal features not available through the REST API.

Instructions

Execute an arbitrary Groovy script on Jenkins.

This tool provides access to Jenkins internal features that are not available via REST API.

Args: script: The Groovy script code to execute.

Returns: The result of the script execution.

Examples: # Basic usage: run_groovy_script(script='println Jenkins.instance.version')

# Access Jenkins information:
run_groovy_script(
    script='''
        def version = Jenkins.instance.version
        def mode = Jenkins.instance.mode
        return "Version: ${version}, Mode: ${mode}"
    '''
)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations, the description carries the full burden. It only states execution and return, but fails to disclose that running arbitrary Groovy scripts can be destructive, requires permissions, or runs on the Jenkins master. This is a significant gap for a tool with such power.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description includes useful examples but is slightly verbose. The main point is clear and front-loaded. Could be more concise by reducing example redundancy.

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?

The tool has one required parameter and an output schema (not shown). The description explains the return value. However, it misses critical context such as safety warnings, risk of destructive actions, and permission requirements, making it incomplete for such a powerful tool.

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 input schema has 0% description coverage (just types). The description adds that 'script' is the Groovy code to execute, which is minimal but clarifies the parameter's role. Baseline is 3 due to low coverage, and the description adds some value.

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 uses a specific verb ('Execute') and resource ('arbitrary Groovy script on Jenkins'), and clearly distinguishes from sibling tools which are mostly read-only or specific operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states the tool provides access to internal features not available via REST API, implying when to use it, and includes examples. However, it does not explicitly mention when not to use or provide alternatives.

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