Skip to main content
Glama
abhijeetka
by abhijeetka

get_jobs

Retrieve all Kubernetes jobs from a specified namespace to monitor batch workloads and track execution status in your cluster.

Instructions

Get all jobs in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • Handler function for the 'get_jobs' MCP tool. Decorated with @mcp.tool() for registration. Executes kubectl get jobs -n {namespace} -o json, parses and returns the JSON output or an error dictionary.
    @mcp.tool()
    async def get_jobs(namespace: str = "default") -> dict:
        """Get all jobs in the specified namespace"""
        try:
            cmd = ["kubectl", "get", "jobs", "-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 jobs: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't disclose whether this is a read-only operation, what permissions are needed, whether results are paginated, or what format the output takes. 'Get all jobs' implies a list operation but lacks details on scope, limits, or error conditions.

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?

Extremely concise single sentence with zero waste. Front-loaded with the core action ('Get all jobs') followed by the key parameter context. Every word earns its place without redundancy.

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?

For a tool with no annotations, no output schema, and minimal schema documentation, the description is inadequate. It doesn't explain what constitutes a 'job' in this system, what information is returned, or how this tool fits into the broader context of sibling tools like 'get_cronjobs' and 'get_deployments'.

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?

With only 1 parameter and 0% schema description coverage, the description compensates by explaining the parameter's purpose ('specified namespace'). However, it doesn't clarify what a namespace is in this context, valid values, or the implications of using 'default' versus other namespaces.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('Get') and resource ('jobs'), but is vague about scope ('all jobs') without clarifying if this includes completed/failed jobs or only active ones. It distinguishes from siblings like 'get_cronjobs' by focusing on jobs, but doesn't explain what a 'job' is in this context.

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 like 'get_deployments' or 'get_cronjobs'. The description mentions 'specified namespace' but doesn't explain when to specify a namespace versus using default, or whether this is for monitoring, debugging, or administrative purposes.

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