Skip to main content
Glama
BenedatLLC

Kubernetes Tools MCP Server

by BenedatLLC

get_cronjob_summaries

List Kubernetes CronJobs in a namespace or across all namespaces, showing each schedule, suspend state, active job count, and last run times.

Instructions

Retrieves a list of CronJobSummary objects for CronJobs in a given namespace or all namespaces, similar to kubectl get cronjobs.

Parameters
----------
namespace : Optional[str], default=None
    The specific namespace to list CronJobs from. If None, lists from all
    namespaces.

Returns
-------
list of CronJobSummary
    A list of CronJobSummary objects, each with the following fields:

    name : str
        Name of the CronJob.
    namespace : str
        Namespace of the CronJob.
    schedule : str
        Cron schedule expression.
    suspend : bool
        Whether the CronJob is suspended.
    active : int
        Number of currently active (running) jobs.
    last_schedule_time : Optional[datetime.timedelta]
        Time since the CronJob was last scheduled (None if never).
    last_successful_time : Optional[datetime.timedelta]
        Time since the CronJob last completed successfully (None if never).
    age : datetime.timedelta
        Age of the CronJob (current time minus creation timestamp).
    containers : list[ContainerTemplateSummary]
        The job pod template's containers, each with name, image, and literal
        environment values.

Raises
------
K8sConfigError
    If unable to initialize the K8S API.
K8sApiError
    If the API call to list CronJobs fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does reasonably well: it enumerates the exact returned fields and documents two error conditions (K8sConfigError on API init failure, K8sApiError on list failure). It doesn't explicitly confirm read-only semantics or note pagination/rate limits, keeping it short of a 5.

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 opening sentence front-loads the purpose effectively and the sectioned layout (Parameters/Returns/Raises) is easy to scan. However, the long field-by-field Returns enumeration partially duplicates the output schema, adding bulk that earns less than its space.

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?

An output schema exists, so the field listing is somewhat redundant, but the description still adds value via the kubectl analogy, error conditions, and namespace semantics. For a simple single-parameter read tool this is essentially complete.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does: it defines the single parameter's type, default (None), and the semantic consequence of None ('lists from all namespaces'). That is complete for a one-parameter tool.

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?

States a specific verb and resource ('Retrieves a list of CronJobSummary objects for CronJobs') and gives a concrete analogy ('similar to kubectl get cronjobs'). This clearly distinguishes it from sibling tools like get_logs_for_cronjob and get_job_summaries.

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

Usage Guidelines3/5

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

The description explains the namespace parameter behavior (None lists all namespaces), which implies usage, but it never states when to prefer this tool over alternatives such as get_job_summaries or get_logs_for_cronjob. No explicit when/when-not guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.