Skip to main content
Glama

get_all_views

Retrieve all top-level Jenkins views with their names and URLs.

Instructions

Get all top-level views from Jenkins.

Returns: A list of views with their name and URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the get_all_views tool. Decorated with @mcp.tool, calls jenkins(ctx).get_views() to fetch all top-level views.
    @mcp.tool(tags=['read'])
    async def get_all_views(ctx: Context) -> list[dict]:
        """Get all top-level views from Jenkins.
    
        Returns:
            A list of views with their name and URL.
        """
        return jenkins(ctx).get_views()
  • Helper method on the Jenkins class that executes the actual REST API call using the VIEWS endpoint.
    def get_views(self) -> list[dict]:
        """Get all top-level views from Jenkins.
    
        Returns:
            A list of dictionaries with 'name' and 'url' for each view.
        """
        response = self.request('GET', rest_endpoint.VIEWS)
        return response.json().get('views', [])
  • Defines the REST API endpoint for fetching top-level views (api/json?tree=views[name,url]).
    VIEWS = RestEndpoint('api/json?tree=views[name,url]')
  • Registration: imports the view module (which includes get_all_views) to trigger the @mcp.tool decorator registration.
    # 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 resolves the Jenkins client instance from the request context, used by the handler.
        )
    
    
    def jenkins(ctx: Context) -> Jenkins:
Behavior4/5

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

With no annotations, the description handles transparency well by stating it returns a list with name and URL. It lacks mention of authentication or rate limits, but for a simple read operation with no side effects, it is adequate.

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 concise with two sentences, front-loaded with the action, and no wasted words. It efficiently conveys the purpose and return format.

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?

Given no parameters and presence of an output schema, the description covers the essential information: it returns a list of views with name and URL. It does not mention pagination, but for a top-level list that is likely acceptable.

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

Parameters4/5

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

There are no parameters, and schema description coverage is 100%. The description adds no parameter information, but baseline for 0 params is 4, so it meets expectations.

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' and the resource 'all top-level views', which distinguishes it from the sibling tool 'get_view' that retrieves a specific view. The specificity of 'top-level' adds precision.

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?

It implies usage for retrieving all top-level views, but does not explicitly state when not to use it (e.g., for nested views) or mention alternatives. The sibling tool 'get_view' provides implicit contrast.

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