Skip to navigation

Module functions

View as MarkdownOpen in Claude

Functions exported from @signalwire/sdk that act on the singleton SkillRegistry, so you don’t call SkillRegistry.getInstance() yourself.

registerSkill

Register a custom skill class, bypassing the directory scan. Proxies to register().

skillClass
typeof SkillBaseRequired

The skill class to register, a subclass of SkillBase.

Returns void.

listSkills

List metadata for every registered skill. Proxies to listSkills().

Returns SkillSchemaInfo[].

listSkillsWithParams

Get the full schema of every registered skill, including parameter metadata. Proxies to getAllSkillsSchema().

Returns Record<string, SkillSchemaInfo>, keyed by skill name.

addSkillDirectory

Add a directory to search for skill modules. Proxies to addSearchPath(), which accepts any path; it does not run the validation of the SkillRegistry.addSkillDirectory() method of the same name.

path
stringRequired

Absolute path to a directory containing skill files.

Returns void.

Example

import { FunctionResult, SkillBase, listSkillsWithParams, registerSkill } from '@signalwire/sdk';
class FareSkill extends SkillBase {
static override SKILL_NAME = 'fare_quote';
static override SKILL_DESCRIPTION = 'Quote a Bayview Taxi fare';
override getTools() {
return [{
name: 'quote_fare',
description: 'Quote the fare between two addresses',
handler: () => new FunctionResult('That trip is about 24 dollars.'),
}];
}
}
registerSkill(FareSkill);
console.log(Object.keys(listSkillsWithParams()));