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

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