Choose a tool target
An AgentTool can point to an API hosted at an external URL or to a Service running inside your Kubernetes cluster. Choose the option that matches your API’s location.
- External URL
- Internal Kubernetes Service
Use the
url field when the target API is reachable over the internet or a routable network address. The operator and the agent container both need egress access to that hostname.Create the AgentTool
Write a full AgentTool manifest and apply it to your cluster. The examples below show both the external URL and internal ServiceRef patterns.External API:Internal Kubernetes service:Apply both:
Attach the tool to your Agent
Reference AgentTools from your Agent spec using Using an inline tool definition (useful for one-off, agent-specific tools):Both patterns can coexist in a single Agent spec — mix
toolRef. You can reference tools in the same namespace or in a different namespace by including the optional namespace field.Using toolRef (recommended for shared tools):toolRef entries for shared tools with inline template entries for tools that are specific to one agent.Verify the tool
List all AgentTool resources and confirm the operator has successfully validated and stored each spec:Inspect a specific tool for detailed status conditions:Look for two conditions in the output:
Validated— confirms the spec fields are syntactically correct.Stored— confirms the operator has persisted the resolved OpenAPI spec in a ConfigMap for runtime use.
status: "False", the message field explains what went wrong — usually an unreachable endpointPath or a malformed spec.Test the tool
With the tool attached and the agent running, check the agent logs to confirm the tool is being called during inference:A successful tool invocation appears in the logs as the agent framework records the call and its result. If you expect the tool to be called but it isn’t, re-read the
description field — the LLM relies on it to decide when invocation is appropriate.OpenAPI schema sources
TheopenApiSchema block is required on every AgentTool. You have three options for supplying the schema.
endpointPath — fetch the spec from the target service
endpointPath — fetch the spec from the target service
The operator issues an HTTP GET to the Use this when the API already exposes a spec at a known path and that path stays stable across deployments.
url or serviceRef base address combined with endpointPath and retrieves the OpenAPI spec at reconciliation time. This is the simplest option when the target API serves its own spec.value — embed the spec inline in the manifest
value — embed the spec inline in the manifest
Provide the entire OpenAPI spec as a YAML object nested directly inside the manifest. The operator uses the embedded spec without making any network calls.Use this for small, simple APIs where the spec is unlikely to change and you want everything in one file.
valueFrom — reference a spec stored in a ConfigMap
valueFrom — reference a spec stored in a ConfigMap
Point to an existing ConfigMap that holds the OpenAPI spec. This is the right choice when the spec is large, managed separately, or shared across multiple tools.Create the ConfigMap in the same namespace as the AgentTool:
Secure API credentials
If the external API requires an authentication header, use a Kubernetes Secret to store the credential and inject it into the agent container as an environment variable. Reference the value from your agent’s environment rather than embedding it in the AgentTool manifest.WEATHER_API_KEY from its environment and attaches it as an Authorization header when the tool makes a call.