getRegisteredTools

View as MarkdownOpen in Claude

Get a summary of all SWAIG tools registered on this service, with their names, descriptions, and parameter schemas. Useful for debugging, building admin interfaces, or listing tools on a standalone SWAIG host.

Parameters

None.

Returns

{ name: string; description: string; parameters: Record<string, unknown> }[] — Array of tool descriptors.

Example

1import { SWMLService } from '@signalwire/sdk';
2
3const service = new SWMLService({ name: 'swaig-host', route: '/' });
4service.defineTool({
5 name: 'get_weather',
6 description: 'Get the current weather',
7 parameters: { type: 'object', properties: { city: { type: 'string' } } },
8 handler: async (args) => ({ response: `Weather in ${args.city}: sunny` }),
9});
10
11const tools = service.getRegisteredTools();
12console.log(tools);
13// [{ name: 'get_weather', description: 'Get the current weather', parameters: { ... } }]