ToolRegistry CRD Reference

The ToolRegistry custom resource defines tools available to AI agents.

API Version

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: ToolRegistry

Spec Fields

tools

List of tool definitions.

spec:
  tools:
    - name: search
      type: http
      url: https://api.example.com/search
      description: "Search the knowledge base"

Tool Definition

Each tool can be defined inline or discovered via selector.

Inline Tool

FieldTypeRequired
namestringYes
typestringYes
urlstringYes (for inline)
descriptionstringNo
- name: calculator
  type: http
  url: https://api.example.com/calculate
  description: "Perform mathematical calculations"

Discovered Tool

FieldTypeRequired
namestringYes
selector.matchLabelsmapYes
portstringNo
- name: kubernetes-tools
  selector:
    matchLabels:
      omnia.altairalabs.ai/tool: "true"
  port: http  # Use specific port name

Tool Types

TypeDescriptionProtocol
httpHTTP REST endpointHTTP/HTTPS
grpcgRPC servicegRPC

Service Discovery

Tools can be automatically discovered from Kubernetes Services.

Service Labels

Services must have the tool label:

metadata:
  labels:
    omnia.altairalabs.ai/tool: "true"

Service Annotations

Customize discovered tool behavior:

AnnotationDescriptionDefault
omnia.altairalabs.ai/tool-pathAPI path/
omnia.altairalabs.ai/tool-descriptionTool descriptionService name
omnia.altairalabs.ai/tool-typeTool typehttp

Example Service:

apiVersion: v1
kind: Service
metadata:
  name: weather-api
  labels:
    omnia.altairalabs.ai/tool: "true"
  annotations:
    omnia.altairalabs.ai/tool-path: "/v1/weather"
    omnia.altairalabs.ai/tool-description: "Get weather forecasts"
spec:
  selector:
    app: weather-service
  ports:
    - name: http
      port: 80
      targetPort: 8080

Status Fields

phase

Current phase of the ToolRegistry.

ValueDescription
PendingDiscovering tools
ReadyAll tools available
DegradedSome tools unavailable
FailedNo tools available

discoveredTools

Number of tools discovered.

availableTools

Number of tools currently available.

conditions

TypeDescription
ToolsAvailableAt least one tool is available
AllToolsReadyAll configured tools are ready

Example

Complete ToolRegistry example:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: ToolRegistry
metadata:
  name: agent-tools
  namespace: agents
spec:
  tools:
    # Inline tool with direct URL
    - name: web-search
      type: http
      url: https://api.search.com/query
      description: "Search the web for information"

    # Inline tool for calculations
    - name: calculator
      type: http
      url: https://api.math.com/calculate
      description: "Perform mathematical operations"

    # Discover tools from labeled services
    - name: internal-tools
      selector:
        matchLabels:
          team: platform
          omnia.altairalabs.ai/tool: "true"

Status after discovery:

status:
  phase: Ready
  discoveredTools: 5
  availableTools: 5
  conditions:
    - type: ToolsAvailable
      status: "True"
    - type: AllToolsReady
      status: "True"

Multi-Port Services

For services with multiple ports, specify which port to use:

- name: multi-port-service
  selector:
    matchLabels:
      app: my-service
  port: api  # Use the port named "api"