Skip to main content
Glama
abhijeetka
by abhijeetka

get_cronjobs

Retrieve scheduled cronjobs from a Kubernetes namespace to monitor automated tasks and job scheduling in your cluster.

Instructions

Get all cronjobs in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • The handler function for the 'get_cronjobs' MCP tool, decorated with @mcp.tool() for automatic registration. It retrieves cronjobs from a Kubernetes namespace using kubectl and returns the JSON output or an error dictionary.
    @mcp.tool()
    async def get_cronjobs(namespace: str = "default") -> dict:
        """Get all cronjobs in the specified namespace"""
        try:
            cmd = ["kubectl", "get", "cronjobs", "-n", namespace, "-o", "json"]
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            return json.loads(result.stdout)
        except subprocess.CalledProcessError as e:
            return {"error": f"Failed to get cronjobs: {str(e)}"}
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets all cronjobs', implying a read-only operation, but doesn't clarify if it requires specific permissions, returns partial/full data, handles errors, or has rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence with zero wasted words. It front-loads the core action ('Get all cronjobs') and specifies the scope directly, making it easy to parse. Every part of the sentence contributes essential information.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely interacts with a cluster system. It doesn't cover behavioral aspects like authentication needs, error handling, or return format, which are critical for an agent to use it correctly. The minimal parameter info and absence of usage guidelines further reduce completeness.

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 mentions 'specified namespace', which aligns with the single parameter in the schema. However, schema description coverage is 0%, so the description adds some semantic context (it's for namespace filtering) but doesn't explain the parameter's purpose, format, or default value beyond what's implied. This meets the baseline for minimal parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 resource ('all cronjobs'), making the purpose unambiguous. It specifies the scope ('in the specified namespace'), which distinguishes it from generic list operations. However, it doesn't explicitly differentiate from similar sibling tools like 'get_jobs' or 'get_deployments' beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing cluster access), compare it to similar tools like 'get_jobs', or indicate scenarios where it's preferred over other listing tools. The only implicit context is the namespace parameter, but no explicit usage rules are given.

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/abhijeetka/mcp-k8s-server'

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