Skip to main content
Glama

deployment_list

List all Kubernetes deployments in a specified namespace to monitor application resources and manage cluster configurations.

Instructions

List all Deployments in a given namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace

Returns: List of Deployment basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The main handler function for the 'deployment_list' tool, decorated with @mcp.tool(). It lists deployments in the specified namespace using the Kubernetes AppsV1Api.
    @mcp.tool()
    @use_current_context
    def deployment_list(context_name: str, namespace: str):
        """
        List all Deployments in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of Deployment basic information
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        deployments = apps_v1.list_namespaced_deployment(namespace)
        result = [{"name": dep.metadata.name} for dep in deployments.items]
        return result
  • server/server.py:7-27 (registration)
    The load_modules function imports the tools.deployment module (line 12), which triggers the registration of the @mcp.tool() decorated functions including deployment_list.
    def load_modules():
        import resources.contexts  # noqa: F401
        import tools.cluster  # noqa: F401
        import tools.configmap  # noqa: F401
        import tools.daemonset  # noqa: F401
        import tools.deployment  # noqa: F401
        import tools.ingress  # noqa: F401
        import tools.namespace  # noqa: F401
        import tools.node  # noqa: F401
        import tools.pod  # noqa: F401
        import tools.pv  # noqa: F401
        import tools.pvc  # noqa: F401
        import tools.replicaset  # noqa: F401
        import tools.role  # noqa: F401
        import tools.secret  # noqa: F401
        import tools.service  # noqa: F401
        import tools.serviceaccount  # noqa: F401
        import tools.statefulset  # noqa: F401
    
    
    load_modules()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose critical traits like authentication needs, rate limits, pagination, error handling, or what 'basic information' includes. For a Kubernetes tool with zero annotation coverage, this leaves significant 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 well-structured and front-loaded with the core purpose, followed by clear Args and Returns sections. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

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?

Given 2 parameters with 0% schema coverage and no output schema, the description partially compensates by documenting parameters and stating the return type. However, for a Kubernetes list tool with no annotations, it lacks details on authentication, error cases, pagination, and the structure of 'basic information', leaving room for improvement.

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?

Schema description coverage is 0%, so the description must compensate. It explicitly documents both parameters ('context_name' and 'namespace') in the Args section, adding meaning beyond the schema's titles. However, it doesn't explain parameter formats (e.g., string constraints) or provide examples, leaving some ambiguity.

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 'List' and resource 'Deployments' with scope 'in a given namespace', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling list tools like 'daemonset_list' or 'statefulset_list' beyond the resource type, which is implied but not stated.

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 like cluster access, compare it to 'deployment_get' for single deployments, or explain why to choose this over other list tools. Usage context is minimal.

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/bourbonkk/k8s-pilot'

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