Skip to main content

Tool CRD

The Tool CRD (charts/stoa-platform/crds/tools.gostoa.dev.yaml) defines an individual HTTP-backed MCP tool watched dynamically by stoa-gateway when compiled with the k8s Cargo feature and started with STOA_K8S_ENABLED=true.

Resource Metadata​

FieldValue
CRD Nametools.gostoa.dev
API Versiongostoa.dev/v1alpha1
KindTool
Short Nametool
ScopeNamespaced
Watcherstoa-gateway (CrdWatcher, exports {namespace}_{snake_case(metadata.name)})

Complete Example​

apiVersion: gostoa.dev/v1alpha1
kind: Tool
metadata:
name: payment-create
namespace: tenant-acme
spec:
displayName: Create Payment
description: Create a new payment transaction
endpoint: https://payments.internal.example.com/v2/payments
method: POST
inputSchema:
type: object
properties:
amount:
type: number
description: Payment amount in cents
currency:
type: string
enum: [EUR, USD, GBP]
default: EUR
recipient:
type: string
description: Recipient account ID
required:
- amount
- recipient
outputSchema:
type: object
properties:
paymentId:
type: string
annotations:
readOnly: false
destructive: false
idempotent: false
openWorld: true

(In namespace tenant-acme, metadata.name: payment-create registers in stoa-gateway under the MCP tool name tenant-acme_payment_create.)

Spec Fields (openAPIV3Schema)​

Required Fields​

All five fields below are enforced as required by the CRD schema:

FieldTypeEnforced Values / ConstraintsDescription
displayNamestringRequiredHuman-readable display name
descriptionstringRequiredTool description exposed to LLM agents
endpointstringRequiredUpstream HTTP(S) endpoint URL
methodstringEnum: GET, POST, PUT, DELETE, PATCHHTTP method used when invoking endpoint
inputSchemaobjectx-kubernetes-preserve-unknown-fields: trueJSON Schema describing tool input arguments

Optional Fields​

FieldTypeDefaultEnforced Values / ConstraintsDescription
outputSchemaobject—x-kubernetes-preserve-unknown-fields: trueOptional JSON Schema for tool output
authstringnoneEnum: bearer, service_account, noneDeclared in CRD schema, not read by CrdWatcher on main
rateLimitstring—Expression string (e.g., 100/min, 1000/hour)Declared in CRD schema, not enforced by CrdWatcher on main
annotations.readOnlyboolean—BooleanHints that the tool does not mutate state
annotations.destructiveboolean—BooleanHints that the tool performs destructive mutations
annotations.idempotentboolean—BooleanHints that repeated calls with identical args are safe
annotations.openWorldboolean—BooleanHints that the tool interacts with external systems

(Note: CrdWatcher::handle_tool_apply (stoa-gateway/src/k8s/watcher.rs) constructs DynamicTool from description, endpoint, method, inputSchema, outputSchema, and annotations; spec.auth and spec.rateLimit are validated by the CRD schema but currently ignored by the Rust watcher. To generate Tool manifests automatically from an OpenAPI specification, use stoactl bridge <spec-file>.)

Status Subresource (status)​

The CRD defines .status fields (registered, lastSeen, error) and printer columns (Display Name, Endpoint, Registered). Note that CrdWatcher on main registers tools in memory without patching .status back to the Kubernetes API server, so .status.registered remains unset unless written by an external controller:

FieldTypeDescription
registeredbooleanSchema field for registration state (not patched by CrdWatcher on main)
lastSeenstringSchema field for last watcher timestamp (not patched by CrdWatcher on main)
errorstringSchema field for registration error details

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the “Cookies” button.

Read the audience measurement details