For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
        • ApiNinjasTriviaSkill
        • AskClaudeSkill
        • ClaudeSkillsSkill
        • CustomSkillsSkill
        • DataSphereServerlessSkill
        • DataSphereSkill
        • DateTimeSkill
        • GoogleMapsSkill
        • InfoGathererSkill
        • JokeSkill
        • MathSkill
        • McpGatewaySkill
        • NativeVectorSearchSkill
        • PlayBackgroundFileSkill
        • SpiderSkill
        • SwmlTransferSkill
        • WeatherApiSkill
        • WebSearchSkill
        • WikipediaSearchSkill
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Skills Summary
  • Configuration
  • SWAIG Field Overrides
  • Multi-Instance Skills
  • Base Parameters
  • Extending SkillBase
  • Defining a Custom Skill
  • Registering with SkillRegistry
  • Using a Custom Skill
  • All Skills
Agents

Skills

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

ApiNinjasTriviaSkill

Next
Built with

Skills are pluggable capabilities that add tools to your agent. Import a skill class, instantiate it with optional configuration, and pass the instance to addSkill(). Each skill registers one or more SWAIG functions automatically and injects prompt sections, hints, and global data.

1import { AgentBase, DateTimeSkill, WebSearchSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'my-agent', route: '/' });
4
5agent.setPromptText('You are a helpful assistant.');
6
7// No-config skill
8await agent.addSkill(new DateTimeSkill());
9
10// Skill with parameters
11await agent.addSkill(new WebSearchSkill({
12 num_results: 5,
13 safe_search: 'high',
14}));
15
16agent.run();

Skills Summary

SkillClassToolsEnv Vars RequiredMulti-Instance
datetimeDateTimeSkill2NoNo
mathMathSkill1NoNo
jokeJokeSkill1NoNo
weather_apiWeatherApiSkill1YesNo
web_searchWebSearchSkill1YesYes
wikipedia_searchWikipediaSearchSkill1NoNo
google_mapsGoogleMapsSkill4YesNo
play_background_filePlayBackgroundFileSkill1-3NoYes
swml_transferSwmlTransferSkill1-2NoYes
datasphereDataSphereSkill1YesYes
datasphere_serverlessDataSphereServerlessSkill1YesYes
native_vector_searchNativeVectorSearchSkill1NoYes
info_gathererInfoGathererSkill2NoYes
api_ninjas_triviaApiNinjasTriviaSkill1YesYes
spiderSpiderSkill3NoYes
ask_claudeAskClaudeSkill1YesNo
claude_skillsClaudeSkillsSkillDynamicNoYes
custom_skillsCustomSkillsSkillDynamicNoNo
mcp_gatewayMcpGatewaySkill1NoNo

Configuration

All skills accept configuration via a config object passed to the skill constructor. Skills with an env_var fallback on a parameter read from process.env when the parameter is not provided directly.

1import { WebSearchSkill } from '@signalwire/sdk';
2
3// Direct configuration
4const skill = new WebSearchSkill({ num_results: 5, safe_search: 'high' });
5
6// Environment variable fallback (api_key falls back to GOOGLE_SEARCH_API_KEY,
7// search_engine_id falls back to GOOGLE_SEARCH_CX)
8process.env.GOOGLE_SEARCH_API_KEY = 'YOUR_KEY';
9process.env.GOOGLE_SEARCH_CX = 'YOUR_ENGINE_ID';
10const skillWithEnv = new WebSearchSkill({ num_results: 5 });

SWAIG Field Overrides

Override SWAIG function metadata for any skill by including a swaig_fields key:

1import { AgentBase, DateTimeSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new DateTimeSkill({
7 swaig_fields: {
8 fillers: { 'en-US': ['Let me check the time...', 'One moment...'] },
9 secure: false,
10 },
11}));
12
13agent.run();

Multi-Instance Skills

Skills that support multiple instances (SUPPORTS_MULTIPLE_INSTANCES = true) can be added to the same agent more than once with different tool_name values:

1import { AgentBase, DataSphereSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new DataSphereSkill({
7 tool_name: 'search_products',
8 document_id: 'doc_products',
9 count: 3,
10}));
11await agent.addSkill(new DataSphereSkill({
12 tool_name: 'search_policies',
13 document_id: 'doc_policies',
14 count: 5,
15}));
16
17agent.run();

Base Parameters

Every skill inherits these parameters from SkillBase:

swaig_fields
object

Additional SWAIG fields to merge into each tool definition provided by this skill (e.g., fillers, secure).

skip_prompt
booleanDefaults to false

When true, suppress all prompt sections from this skill.


Extending SkillBase

Create custom skills by extending SkillBase and registering them with the SkillRegistry.

Defining a Custom Skill

1import { SkillBase, FunctionResult } from '@signalwire/sdk';
2import type {
3 SkillToolDefinition,
4 SkillPromptSection,
5 ParameterSchemaEntry,
6} from '@signalwire/sdk';
7
8export class StockPriceSkill extends SkillBase {
9 // Identity is declared with static class constants.
10 static override SKILL_NAME = 'stock_price';
11 static override SKILL_DESCRIPTION = 'Look up current stock prices.';
12 static override SKILL_VERSION = '1.0.0';
13 static override REQUIRED_ENV_VARS = ['STOCK_API_KEY'] as const;
14
15 static override getParameterSchema(): Record<string, ParameterSchemaEntry> {
16 return {
17 ...super.getParameterSchema(),
18 api_key: {
19 type: 'string',
20 description: 'Stock API key.',
21 hidden: true,
22 env_var: 'STOCK_API_KEY',
23 required: true,
24 },
25 };
26 }
27
28 override getTools(): SkillToolDefinition[] {
29 return [
30 {
31 name: 'get_stock_price',
32 description: 'Get the current price of a stock by ticker symbol.',
33 parameters: {
34 symbol: {
35 type: 'string',
36 description: 'Stock ticker symbol (e.g., "AAPL", "GOOG").',
37 },
38 },
39 required: ['symbol'],
40 handler: async (args: Record<string, unknown>) => {
41 const symbol = args.symbol as string;
42 // Your implementation here
43 return new FunctionResult(
44 'The current price of ' + symbol + ' is $150.00.',
45 );
46 },
47 },
48 ];
49 }
50
51 protected override _getPromptSections(): SkillPromptSection[] {
52 return [
53 {
54 title: 'Stock Prices',
55 body: 'You can look up current stock prices.',
56 bullets: [
57 'Use the get_stock_price tool when the user asks about a stock price.',
58 'Provide the stock ticker symbol (e.g., AAPL for Apple).',
59 ],
60 },
61 ];
62 }
63}

Registering with SkillRegistry

1import { SkillRegistry } from '@signalwire/sdk';
2import { StockPriceSkill } from './stock-price-skill.js';
3
4const registry = SkillRegistry.getInstance();
5registry.register(StockPriceSkill); // pass the class; name comes from SKILL_NAME

Using a Custom Skill

1import { AgentBase } from '@signalwire/sdk';
2import { StockPriceSkill } from './stock-price-skill.js';
3
4const agent = new AgentBase({ name: 'finance-bot', route: '/' });
5agent.setPromptText('You are a financial assistant.');
6
7await agent.addSkill(new StockPriceSkill());
8
9agent.run();

For more details on the skill base class, see SkillBase.


All Skills

DateTimeSkill

Get the current date and time with optional timezone support.

MathSkill

Evaluate mathematical expressions safely.

JokeSkill

Tell jokes from a built-in collection.

WeatherApiSkill

Get current weather conditions using OpenWeatherMap.

WebSearchSkill

Search the web using Google Custom Search.

WikipediaSearchSkill

Search Wikipedia for article summaries.

GoogleMapsSkill

Get directions and search for places using Google Maps.

PlayBackgroundFileSkill

Control background audio playback during calls.

SwmlTransferSkill

Transfer calls using SWML transfer actions.

DataSphereSkill

Search SignalWire DataSphere documents.

DataSphereServerlessSkill

Search DataSphere documents serverlessly.

NativeVectorSearchSkill

In-memory document search using word overlap scoring.

InfoGathererSkill

Collect structured information from the user.

ApiNinjasTriviaSkill

Fetch trivia questions from API Ninjas.

SpiderSkill

Scrape webpage content using the Spider API.

AskClaudeSkill

Send prompts to Anthropic’s Claude AI.

ClaudeSkillsSkill

Load Claude Code-style SKILL.md files as tools.

CustomSkillsSkill

Register user-defined tools from configuration.

McpGatewaySkill

Model Context Protocol server integration.