Skip to main content
Glama

daemonset_create

Create a DaemonSet in Kubernetes to run a container image on every node within a specified namespace, applying labels for organization.

Instructions

Create a DaemonSet in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The DaemonSet name image: The container image to use labels: Labels to apply to the DaemonSet

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
imageYes
labelsYes

Implementation Reference

  • The main handler function for the 'daemonset_create' tool. It is decorated with @mcp.tool() which registers it as an MCP tool, @use_current_context for context management, and @check_readonly_permission for access control. The function creates a Kubernetes DaemonSet in the specified namespace using the provided parameters.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def daemonset_create(context_name: str, namespace: str, name: str, image: str, labels: dict):
        """
        Create a DaemonSet in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The DaemonSet name
            image: The container image to use
            labels: Labels to apply to the DaemonSet
    
        Returns:
            Status of the creation operation
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        daemonset = V1DaemonSet(
            metadata=V1ObjectMeta(name=name, labels=labels),
            spec={
                "selector": {"matchLabels": labels},
                "template": V1PodTemplateSpec(
                    metadata=V1ObjectMeta(labels=labels),
                    spec=V1PodSpec(containers=[V1Container(name=name, image=image)])
                )
            }
        )
        created_daemonset = apps_v1.create_namespaced_daemon_set(namespace=namespace, body=daemonset)
        return {"name": created_daemonset.metadata.name, "status": "Created"}
  • The @mcp.tool() decorator registers the daemonset_create function as an MCP tool.
    @mcp.tool()
  • Function signature with type hints and docstring defining the input schema and output for the tool.
    def daemonset_create(context_name: str, namespace: str, name: str, image: str, labels: dict):
        """
        Create a DaemonSet in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The DaemonSet name
            image: The container image to use
            labels: Labels to apply to the DaemonSet
    
        Returns:
            Status of the creation operation
        """
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write operation, it doesn't mention required permissions, whether this is idempotent, what happens on conflicts, or any rate limits. The return statement is vague ('Status of the creation operation') without specifying format or possible outcomes.

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 description is well-structured with clear sections (purpose, Args, Returns) and uses minimal sentences. Every sentence serves a purpose, though the return statement could be more specific. The formatting with clear headers enhances readability.

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 Kubernetes mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks critical context about authentication requirements, error conditions, what constitutes valid input values, and detailed behavioral expectations for a write operation in a complex system.

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 0% schema description coverage, the description compensates well by listing all 5 parameters with brief explanations in the Args section. Each parameter gets a clear semantic description that adds meaning beyond the schema's titles, though it doesn't provide format details or examples.

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 action ('Create a DaemonSet') and the target resource ('in the specified namespace'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'deployment_create' or 'statefulset_create' beyond mentioning DaemonSet specifically.

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 like 'daemonset_update' or other resource creation tools. It lacks context about prerequisites, when this operation is appropriate, or any exclusions.

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