deployment_get
Retrieve detailed information about a specific Kubernetes Deployment by specifying the context name, namespace, and Deployment name using the k8s-pilot MCP server.
Instructions
Get details of a specific Deployment.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name
Returns: Detailed information about the Deployment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/deployment.py:61-82 (handler)The deployment_get tool handler: retrieves detailed information about a specific Kubernetes Deployment using the AppsV1Api, including name, replicas, labels, and container images.@mcp.tool() @use_current_context def deployment_get(context_name: str, namespace: str, name: str): """ Get details of a specific Deployment. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name Returns: Detailed information about the Deployment """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] deployment = apps_v1.read_namespaced_deployment(name=name, namespace=namespace) return { "name": deployment.metadata.name, "replicas": deployment.spec.replicas, "labels": deployment.metadata.labels, "containers": [c.image for c in deployment.spec.template.spec.containers] }
- tools/deployment.py:61-61 (registration)The @mcp.tool() decorator registers the deployment_get function as an MCP tool.@mcp.tool()