SWAIG function signature request
Sent once per SWAIG.includes entry when an AI agent loads, to discover the functions your server hosts. Every way of building an agent sends it — SWML you write yourself, SWML a Server SDK generates, or an agent you configure in your Dashboard — because they all resolve includes the same way.
Reply with the function definitions you host, each shaped like an entry in SWAIG.functions — function, description, and parameters. Three forms are accepted:
- an array of definitions, the usual one;
- a single definition on its own;
- an object {functions, defaults}, where defaults sets SWAIG defaults across the definitions it carries — useful when they share a web_hook_url or auth.
Every definition you return is registered, whether or not it was named in the request's functions list.
This is not the payload a function call sends. It goes to the includes entry's url, using auth_user and auth_password when set. Your endpoint can also receive it outside of a call, as a check that it answers, so answer it the same way. When your project has a signing key, the request carries an X-SignalWire-Signature header you can verify.
Payload
Example payload
{
"action": "get_signature",
"functions": [
"get_weather"
],
"meta_data": {
"store_id": "sf-01"
},
"meta_data_token": "my-token",
"content_type": "text/swaig",
"content_disposition": "function signature request",
"version": "2.0",
"project_id": "4d0d6f16-5881-4fcc-92a4-02c51a91954d",
"space_id": "451ed9ff-e568-4222-8af9-4f9ab7428d09"
}Response
Webhook received