Skip to main content
Glama

deployment_list

Retrieve a list of Kubernetes Deployments in a specified namespace using the k8s-pilot MCP server. Streamlines cluster management by providing basic deployment information for efficient context-based operations.

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. It lists deployments in a Kubernetes namespace using the AppsV1Api. Decorated with @mcp.tool() for registration and @use_current_context for context management.
    @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
  • Registers the deployment_list function as an MCP tool using the @mcp.tool() decorator.
    @mcp.tool()

Other Tools

Related 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