Skip to main content
The AgentTool CRD lets you expose any HTTP API as a callable tool for your AI agents. Each AgentTool is backed by an OpenAPI specification — the operator stores this schema and makes it available to agents so their underlying LLM framework knows exactly which operations are available, what parameters each operation accepts, and what responses to expect. You can target external URLs or internal Kubernetes services, and you can share a single AgentTool across many agents in different namespaces.

API reference


Basic structure

The description field is critical — the LLM reads it to decide when and whether to invoke the tool. Write it as a clear, one-sentence summary of what the API does.

OpenAPI schema sources

The OpenAPI schema is required for every AgentTool. It tells the LLM what operations are available and what shape the request and response payloads take. You can supply the schema in three ways:
The simplest option: the operator fetches the schema directly from a path on the target service. Use this when your service already serves its own OpenAPI spec.

Target configuration

Point the tool at any publicly reachable or VPN-accessible HTTP endpoint. You can attach custom headers and a timeout:

Using tools in agents

You can attach tools to an Agent either by referencing an existing AgentTool CR or by defining the tool inline in the Agent spec. Referencing an AgentTool CR (recommended):
Inline tool definition (no separate CR needed):
Inline tool definitions cannot be reused across multiple agents. Extract frequently used tools into standalone AgentTool CRs and share them by reference.

Status fields

The operator validates and stores each tool’s OpenAPI spec. The resulting status looks like:

Security

API credentials via secrets

Never embed API keys or bearer tokens as plain strings in tool headers. Instead, inject them as environment variables in the agent container and reference them at runtime:

Network policies

Use a NetworkPolicy to restrict which services your agents may reach through their tools:

Troubleshooting

  • Confirm the Validated and Stored conditions are both True.
  • Check that toolRef.name and toolRef.namespace match the actual AgentTool metadata exactly.
  • Ensure the OpenAPI spec contains at least one operation (paths entry).
Also check whether the target service is under load, and whether any NetworkPolicies are delaying or dropping packets.
  • For endpointPath: verify the path returns a valid JSON or YAML OpenAPI document.
  • For valueFrom: confirm the ConfigMap exists in the same namespace and the key contains valid YAML or JSON.
  • For value: check that the inline object is well-formed YAML with no tab characters.
  • Use an online validator (e.g., editor.swagger.io) to confirm spec correctness before applying.
  • Ensure serviceRef.namespace matches the namespace where the Service lives.
  • Confirm serviceRef.port matches a port defined on the Service spec.
  • Check that NetworkPolicies in the target namespace allow ingress from the agent pod.

Best practices

  1. Write a precise description — the LLM relies entirely on this text to decide when to call the tool, so be specific about what the API does and what inputs it expects.
  2. Prefer endpointPath when your service serves its own OpenAPI spec — it keeps the AgentTool manifest minimal and the spec always up to date.
  3. Use valueFrom for large or shared specs — storing the spec in a ConfigMap allows it to be managed independently and rolled back separately.
  4. Use serviceRef for in-cluster targets — it avoids external DNS round-trips and integrates naturally with Kubernetes NetworkPolicies.
  5. Set conservative timeouts — a stuck tool call blocks the entire agent turn; use timeoutSeconds that match the API’s p99 latency plus a buffer.
  6. Share tools via a dedicated namespace — create reusable AgentTool CRs in shared-tools and reference them with toolRef.namespace rather than duplicating definitions.
  7. Store API credentials in Secrets — inject them into the agent container environment rather than hard-coding them in tool headers.
  8. Test tools in isolation before attaching them to agents — verify the target endpoint is reachable and returns a valid OpenAPI spec independently.
  9. Version your tool manifests alongside application code so schema changes are auditable.