Skip to main content
An agent asked to “count all resource requests and limits across all pods” returned a full capacity report in 56ms — from a single API call. All the computation happened inside the sandbox.

The Numbers

The Code

Why This Matters

The Kubernetes API returns raw pod specs — CPU in millicores ("100m"), memory in mixed units ("256Mi", "1Gi", "131072Ki"). A traditional MCP tool would dump all that raw JSON into the LLM’s context and hope it can do math. Code Mode puts the computation in the sandbox. The agent wrote unit parsers for CPU and memory, iterated every container in every running pod, aggregated totals, and returned a clean capacity report. The LLM context received a sorted summary — not the raw specs of 11 pods.

What the Agent Does

  1. Fetches all pods across all namespaces (single API call)
  2. Writes CPU millicore and memory unit parsers
  3. Iterates every container in every running pod
  4. Aggregates requests and limits per-pod and cluster-wide
  5. Converts back to human-readable units, sorts by memory
  6. Returns a formatted capacity report