Skip to main content
Glama

code_context

Read-only

The runtime context a coding agent needs to fix a workload's code, in one compact read. For a Deployment, StatefulSet, DaemonSet or Pod it returns: (1) each container's image and digest mapped to the commit it was built from - repository owner/name, branch and full sha - from Ankra Pipelines publish records (the immutable sha- tag or the digest) or the Ankra application installed in the namespace, else the image's own org.opencontainers.image.revision label (via oci_label), else commit.state unresolved or ambiguous with the reason; (2) when the running revision started (its ReplicaSet or ControllerRevision) and the previous revision's images and commits; (3) the error lines in the running revision's container logs, including the previous (crashed) instance of a restarting container, grouped by fingerprint (numbers, ids and timestamps stripped) with counts, samples and before_deploy: seen, not_seen or unknown in the log store's window before the deploy; (4) the stack frames in those lines (Go, Python, Node, Java) as repository-relative file:line guesses with a link to the line at the deployed commit; (5) restarts and the last termination (OOMKilled, Error, exit code) per container. Call it FIRST when asked to fix, debug or explain a crashing or erroring service in code, when asked which commit a workload runs, or before handing a production error to a coding agent, then read the named files at the named commit. An unknown or unresolved part is a read that did not happen, never a finding. Read-only; secrets in log lines are redacted; the result stays under 8 KB.

Input Schema

NameRequiredDescriptionDefault
kindNoKind of the named workload. Optional: Deployment, StatefulSet, DaemonSet and Pod are tried in that order when omitted.
nameYesName of the Deployment, StatefulSet, DaemonSet or Pod. A pod name is followed to its controller.
containerNoRead only this container's image and logs. Optional; every container of the pod template by default.
namespaceYesNamespace of the workload.
cluster_idYesAnkra cluster id (UUID) the call targets. Discover ids with list_clusters.
max_samplesNoSample lines kept per error fingerprint (default 2, max 5).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, it discloses that it is read-only, that secrets in log lines are redacted, that results stay under 8 KB, and that unresolved parts mean a read did not happen rather than a finding. It also explains fallback resolution across Ankra Pipelines, the Ankra application, and OCI revision labels, which is rich behavioral context an agent needs.

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 long but front-loads its purpose in the first sentence and structures the five returned components as a numbered list, so it remains navigable. It is dense and could be trimmed if an output schema existed, but for a tool with no output schema the detail is largely earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the full burden of explaining return values and does so thoroughly: it enumerates the five result components, the resolution fallback chain, the grouping behavior, and the size and redaction constraints. An agent has enough information to call it correctly and interpret the result.

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?

Schema description coverage is 100%, so the schema already documents all six parameters including their defaults and enum. The description does not add per-parameter meaning beyond what the schema provides, so the baseline of 3 is appropriate for a tool whose parameter semantics are fully carried by the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — a single compact read that returns runtime context (image-to-commit mapping, revision timing, error log lines, stack frames, restart details) for a Kubernetes workload. It is unmistakably distinct from siblings like get_pod_logs or get_deployments because it aggregates commit provenance, logs, and stack frames together, and it frames itself as the first call for debugging code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance: call it FIRST when fixing, debugging, or explaining a crashing service, when asked which commit a workload runs, or before handing a production error to a coding agent. It does not name alternative tools or state when not to use it, so it falls short of the top score, but the triggering conditions are clear and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources