Skip to main content

Functions

Functions define structured actions that the assistant can call - also called Tools.

A function describes the shape of an action: its name, description, and parameters; the actual execution is handled by adapters through routing and policy configuration.

Functions are declared under [functions].

[functions]

[functions.dispatch_single_webhook]
description = "Send a single webhook event with rich payload metadata for downstream automations."
name = "dispatch_single_webhook"

Function names

Each function is defined under a named key:

[functions.dispatch_single_webhook]

The function also contains a name field:

name = "dispatch_single_webhook"

The table key and the name field should match.

Description

The description field explains when the assistant should use the function.

description = "Send a single webhook event with rich payload metadata for downstream automations."

Write descriptions for the model and for operators; a good description is specific enough that the assistant can choose the function correctly.

Parameters

Function parameters describe the JSON object the assistant must produce when calling the function.

[functions.dispatch_single_webhook.parameters]
required = ["event_name", "customer_id", "priority", "summary"]
type = "object"

The required array lists fields that must be present.

The type = "object" value means the function input is a structured object.

Properties

Properties define the accepted fields inside the function input.

[functions.dispatch_single_webhook.parameters.properties]
customer_id = { type = "string" }
event_name = { description = "Canonical event name", type = "string" }
metadata = { additionalProperties = true, type = "object" }
summary = { type = "string" }

Each property describes one field.

Use type = "string" for text values, type = "number" for numeric values, type = "object" for nested metadata, and type = "array" for lists.

Enums

Enums restrict values to a known set.

[functions.dispatch_single_webhook.parameters.properties.channel]
enum = ["voice", "sms", "email"]
type = "string"

[functions.dispatch_single_webhook.parameters.properties.priority]
enum = ["low", "normal", "high", "critical"]
type = "string"

Use enums when the receiving system expects a fixed vocabulary.

This reduces ambiguity and helps the assistant produce valid function calls.

Arrays

Array properties define list inputs.

[functions.dispatch_single_webhook.parameters.properties.tags]
items = { type = "string" }
type = "array"

This example defines tags as an array of strings.

Multi-step workflow function

This function is designed to trigger a pipeline adapter.

[functions.dispatch_multi_webhook_pipeline]
description = "Run a multi-step webhook workflow (validate, process, audit) for production integrations."
name = "dispatch_multi_webhook_pipeline"

[functions.dispatch_multi_webhook_pipeline.parameters]
required = ["workflow_id", "customer_id", "action"]
type = "object"

[functions.dispatch_multi_webhook_pipeline.parameters.properties]
action = { type = "string" }
amount = { type = "number" }
currency = { type = "string" }
customer_id = { type = "string" }
metadata = { additionalProperties = true, type = "object" }
order_id = { type = "string" }
reason = { type = "string" }
workflow_id = { type = "string" }

The function defines the structured input; the router decides which adapter should execute it.

How functions connect to policies

A function is available only when the active policy allows it.

[policies.default]
functions = ["dispatch_single_webhook", "dispatch_multi_webhook_pipeline"]

This means the profile using policies.default can expose those functions.

How functions connect to routers

Routers map function names or detected intents to adapters.

[[routers.intent.default.routes.dispatch_multi_webhook_pipeline]]
adapter = "multi_webhook_workflow"
priority = 200

In this example, calling dispatch_multi_webhook_pipeline routes execution to the multi_webhook_workflow adapter.