Skip to main content
Glama
abhijeetka
by abhijeetka

get_services

Retrieve all Kubernetes services in a specified namespace to monitor and manage network access for applications.

Instructions

Get all services in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • Handler function for the 'get_services' tool. Uses kubectl to fetch services in the given namespace as JSON, decorated with @mcp.tool() for registration.
    @mcp.tool()
    async def get_services(namespace: str = "default") -> dict:
        """Get all services in the specified namespace"""
        try:
            cmd = ["kubectl", "get", "services", "-n", namespace, "-o", "json"]
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            return json.loads(result.stdout)
        except subprocess.CalledProcessError as e:
            return {"error": f"Failed to get services: {str(e)}"}
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets' services, implying a read-only operation, but doesn't specify if it's safe, what data is returned (e.g., list format, metadata), or any constraints like rate limits or authentication needs. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that front-loads the core purpose ('Get all services') without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it appropriately sized and well-structured.

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?

Given the complexity (Kubernetes service retrieval), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover what 'services' entail in this context, return format, error handling, or how it fits with sibling tools like 'get_pods'. For a tool in a rich ecosystem, more context is needed to be fully helpful.

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

Parameters3/5

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

The description adds minimal meaning beyond the input schema. It mentions 'specified namespace,' which aligns with the 'namespace' parameter in the schema, but with 0% schema description coverage, the schema lacks details on this parameter. The description doesn't explain what a namespace is, default behavior, or valid values, offering little compensation for the coverage gap.

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 ('Get all services') and resource ('services in the specified namespace'), making the purpose immediately understandable. It distinguishes from siblings like 'get_pods' or 'get_deployments' by specifying the resource type. However, it doesn't specify the verb's scope beyond 'all' (e.g., whether it returns active only, includes metadata).

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing cluster access), exclusions (e.g., not for filtered views), or related tools like 'expose_service' or 'describe_pod' for different use cases. It's a basic statement without contextual advice.

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/abhijeetka/mcp-k8s-server'

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