> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Skills

> Built-in skills catalog with configuration parameters and usage patterns.

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

[sw-search]: /docs/server-sdks/reference/typescript/agents/cli/sw-search

[infogathereragent]: /docs/server-sdks/reference/typescript/agents/prefabs#infogathereragent

[skillbase]: /docs/server-sdks/reference/typescript/agents/skill-base

[ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map

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()`][add-skill]. Each skill registers
one or more SWAIG functions automatically and injects prompt sections, hints, and
global data.

```typescript {8,11-14}
import { AgentBase, DateTimeSkill, WebSearchSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'my-agent', route: '/' });

agent.setPromptText('You are a helpful assistant.');

// No-config skill
await agent.addSkill(new DateTimeSkill());

// Skill with parameters
await agent.addSkill(new WebSearchSkill({
  num_results: 5,
  safe_search: 'high',
}));

agent.run();
```

## Skills Summary

| Skill                                                                                                 | Class                       | Tools   | Env Vars Required | Multi-Instance |
| ----------------------------------------------------------------------------------------------------- | --------------------------- | ------- | ----------------- | -------------- |
| [`datetime`](/docs/server-sdks/reference/typescript/agents/skills/datetime)                           | `DateTimeSkill`             | 2       | No                | No             |
| [`math`](/docs/server-sdks/reference/typescript/agents/skills/math)                                   | `MathSkill`                 | 1       | No                | No             |
| [`joke`](/docs/server-sdks/reference/typescript/agents/skills/joke)                                   | `JokeSkill`                 | 1       | No                | No             |
| [`weather_api`](/docs/server-sdks/reference/typescript/agents/skills/weather-api)                     | `WeatherApiSkill`           | 1       | Yes               | No             |
| [`web_search`](/docs/server-sdks/reference/typescript/agents/skills/web-search)                       | `WebSearchSkill`            | 1       | Yes               | Yes            |
| [`wikipedia_search`](/docs/server-sdks/reference/typescript/agents/skills/wikipedia-search)           | `WikipediaSearchSkill`      | 1       | No                | No             |
| [`google_maps`](/docs/server-sdks/reference/typescript/agents/skills/google-maps)                     | `GoogleMapsSkill`           | 4       | Yes               | No             |
| [`play_background_file`](/docs/server-sdks/reference/typescript/agents/skills/play-background-file)   | `PlayBackgroundFileSkill`   | 1-3     | No                | Yes            |
| [`swml_transfer`](/docs/server-sdks/reference/typescript/agents/skills/swml-transfer)                 | `SwmlTransferSkill`         | 1-2     | No                | Yes            |
| [`datasphere`](/docs/server-sdks/reference/typescript/agents/skills/datasphere)                       | `DataSphereSkill`           | 1       | Yes               | Yes            |
| [`datasphere_serverless`](/docs/server-sdks/reference/typescript/agents/skills/datasphere-serverless) | `DataSphereServerlessSkill` | 1       | Yes               | Yes            |
| [`native_vector_search`](/docs/server-sdks/reference/typescript/agents/skills/native-vector-search)   | `NativeVectorSearchSkill`   | 1       | No                | Yes            |
| [`info_gatherer`](/docs/server-sdks/reference/typescript/agents/skills/info-gatherer)                 | `InfoGathererSkill`         | 2       | No                | Yes            |
| [`api_ninjas_trivia`](/docs/server-sdks/reference/typescript/agents/skills/api-ninjas-trivia)         | `ApiNinjasTriviaSkill`      | 1       | Yes               | Yes            |
| [`spider`](/docs/server-sdks/reference/typescript/agents/skills/spider)                               | `SpiderSkill`               | 3       | No                | Yes            |
| [`ask_claude`](/docs/server-sdks/reference/typescript/agents/skills/ask-claude)                       | `AskClaudeSkill`            | 1       | Yes               | No             |
| [`claude_skills`](/docs/server-sdks/reference/typescript/agents/skills/claude-skills)                 | `ClaudeSkillsSkill`         | Dynamic | No                | Yes            |
| [`custom_skills`](/docs/server-sdks/reference/typescript/agents/skills/custom-skills)                 | `CustomSkillsSkill`         | Dynamic | No                | No             |
| [`mcp_gateway`](/docs/server-sdks/reference/typescript/agents/skills/mcp-gateway)                     | `McpGatewaySkill`           | 1       | No                | No             |

## 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.

```typescript {4}
import { WebSearchSkill } from '@signalwire/sdk';

// Direct configuration
const skill = new WebSearchSkill({ num_results: 5, safe_search: 'high' });

// Environment variable fallback (api_key falls back to GOOGLE_SEARCH_API_KEY,
// search_engine_id falls back to GOOGLE_SEARCH_CX)
process.env.GOOGLE_SEARCH_API_KEY = 'YOUR_KEY';
process.env.GOOGLE_SEARCH_CX = 'YOUR_ENGINE_ID';
const skillWithEnv = new WebSearchSkill({ num_results: 5 });
```

### SWAIG Field Overrides

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

```typescript {6-11}
import { AgentBase, DateTimeSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new DateTimeSkill({
  swaig_fields: {
    fillers: { 'en-US': ['Let me check the time...', 'One moment...'] },
    secure: false,
  },
}));

agent.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:

```typescript {6-9,10-13}
import { AgentBase, DataSphereSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new DataSphereSkill({
  tool_name: 'search_products',
  document_id: 'doc_products',
  count: 3,
}));
await agent.addSkill(new DataSphereSkill({
  tool_name: 'search_policies',
  document_id: 'doc_policies',
  count: 5,
}));

agent.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`** `boolean` — default: false

When `true`, suppress all prompt sections from this skill.

---

---

## Extending SkillBase

Create custom skills by extending [`SkillBase`][skillbase] and registering
them with the `SkillRegistry`.

### Defining a Custom Skill

```typescript {10-14}
import { SkillBase, FunctionResult } from '@signalwire/sdk';
import type {
  SkillToolDefinition,
  SkillPromptSection,
  ParameterSchemaEntry,
} from '@signalwire/sdk';

export class StockPriceSkill extends SkillBase {
  // Identity is declared with static class constants.
  static override SKILL_NAME = 'stock_price';
  static override SKILL_DESCRIPTION = 'Look up current stock prices.';
  static override SKILL_VERSION = '1.0.0';
  static override REQUIRED_ENV_VARS = ['STOCK_API_KEY'] as const;

  static override getParameterSchema(): Record<string, ParameterSchemaEntry> {
    return {
      ...super.getParameterSchema(),
      api_key: {
        type: 'string',
        description: 'Stock API key.',
        hidden: true,
        env_var: 'STOCK_API_KEY',
        required: true,
      },
    };
  }

  override getTools(): SkillToolDefinition[] {
    return [
      {
        name: 'get_stock_price',
        description: 'Get the current price of a stock by ticker symbol.',
        parameters: {
          symbol: {
            type: 'string',
            description: 'Stock ticker symbol (e.g., "AAPL", "GOOG").',
          },
        },
        required: ['symbol'],
        handler: async (args: Record<string, unknown>) => {
          const symbol = args.symbol as string;
          // Your implementation here
          return new FunctionResult(
            'The current price of ' + symbol + ' is $150.00.',
          );
        },
      },
    ];
  }

  protected override _getPromptSections(): SkillPromptSection[] {
    return [
      {
        title: 'Stock Prices',
        body: 'You can look up current stock prices.',
        bullets: [
          'Use the get_stock_price tool when the user asks about a stock price.',
          'Provide the stock ticker symbol (e.g., AAPL for Apple).',
        ],
      },
    ];
  }
}
```

### Registering with SkillRegistry

```typescript {4-5}
import { SkillRegistry } from '@signalwire/sdk';
import { StockPriceSkill } from './stock-price-skill.js';

const registry = SkillRegistry.getInstance();
registry.register(StockPriceSkill); // pass the class; name comes from SKILL_NAME
```

### Using a Custom Skill

```typescript {7}
import { AgentBase } from '@signalwire/sdk';
import { StockPriceSkill } from './stock-price-skill.js';

const agent = new AgentBase({ name: 'finance-bot', route: '/' });
agent.setPromptText('You are a financial assistant.');

await agent.addSkill(new StockPriceSkill());

agent.run();
```

For more details on the skill base class, see [`SkillBase`][skillbase].

---

## All Skills

#### [DateTimeSkill](/docs/server-sdks/reference/typescript/agents/skills/datetime)

Get the current date and time with optional timezone support.

#### [MathSkill](/docs/server-sdks/reference/typescript/agents/skills/math)

Evaluate mathematical expressions safely.

#### [JokeSkill](/docs/server-sdks/reference/typescript/agents/skills/joke)

Tell jokes from a built-in collection.

#### [WeatherApiSkill](/docs/server-sdks/reference/typescript/agents/skills/weather-api)

Get current weather conditions using OpenWeatherMap.

#### [WebSearchSkill](/docs/server-sdks/reference/typescript/agents/skills/web-search)

Search the web using Google Custom Search.

#### [WikipediaSearchSkill](/docs/server-sdks/reference/typescript/agents/skills/wikipedia-search)

Search Wikipedia for article summaries.

#### [GoogleMapsSkill](/docs/server-sdks/reference/typescript/agents/skills/google-maps)

Get directions and search for places using Google Maps.

#### [PlayBackgroundFileSkill](/docs/server-sdks/reference/typescript/agents/skills/play-background-file)

Control background audio playback during calls.

#### [SwmlTransferSkill](/docs/server-sdks/reference/typescript/agents/skills/swml-transfer)

Transfer calls using SWML transfer actions.

#### [DataSphereSkill](/docs/server-sdks/reference/typescript/agents/skills/datasphere)

Search SignalWire DataSphere documents.

#### [DataSphereServerlessSkill](/docs/server-sdks/reference/typescript/agents/skills/datasphere-serverless)

Search DataSphere documents serverlessly.

#### [NativeVectorSearchSkill](/docs/server-sdks/reference/typescript/agents/skills/native-vector-search)

In-memory document search using word overlap scoring.

#### [InfoGathererSkill](/docs/server-sdks/reference/typescript/agents/skills/info-gatherer)

Collect structured information from the user.

#### [ApiNinjasTriviaSkill](/docs/server-sdks/reference/typescript/agents/skills/api-ninjas-trivia)

Fetch trivia questions from API Ninjas.

#### [SpiderSkill](/docs/server-sdks/reference/typescript/agents/skills/spider)

Scrape webpage content using the Spider API.

#### [AskClaudeSkill](/docs/server-sdks/reference/typescript/agents/skills/ask-claude)

Send prompts to Anthropic's Claude AI.

#### [ClaudeSkillsSkill](/docs/server-sdks/reference/typescript/agents/skills/claude-skills)

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

#### [CustomSkillsSkill](/docs/server-sdks/reference/typescript/agents/skills/custom-skills)

Register user-defined tools from configuration.

#### [McpGatewaySkill](/docs/server-sdks/reference/typescript/agents/skills/mcp-gateway)

Model Context Protocol server integration.