toggleFunctions

View as MarkdownOpen in Claude

Enable or disable specific SWAIG functions at runtime. This lets you control which tools are available to the AI at different points in the conversation (e.g., enabling payment functions only after identity verification).

Parameters

toggles
{ function: string; active: boolean }[]Required

Array of toggle objects. Each object must contain:

  • "function" — name of the SWAIG function to toggle
  • "active"true to enable, false to disable

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .toggleFunctions([
5 { function: 'transfer_call', active: false },
6 { function: 'check_balance', active: true },
7 ]);