Server SDKs
Build AI agents, control calls, send messages, and more
Look up a registered SwaigFunction by name.
SwaigFunction
The tool name to search for.
SwaigFunction | undefined — The SwaigFunction instance, or undefined if not found or not a SwaigFunction.
SwaigFunction | undefined
undefined
1import { AgentBase } from '@signalwire/sdk';23const agent = new AgentBase({ name: 'assistant', route: '/assistant' });4agent.defineTool({5 name: 'get_weather',6 description: 'Get the current weather',7 parameters: {8 type: 'object',9 properties: { city: { type: 'string' } },10 },11 handler: async (args) => ({ response: `Weather in ${args.city}: sunny` }),12});1314const tool = agent.getTool('get_weather');15if (tool) {16 console.log(tool.description); // "Get the current weather"17}