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
  • tools
  • prompt_title
  • prompt_body
AgentsSkills

CustomSkillsSkill

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

DataSphereServerlessSkill

Next
Built with

A meta-skill that registers user-defined tools from configuration. Define tools with names, descriptions, parameters, and JavaScript handler code without writing skill classes.

Class: CustomSkillsSkill

Tools: Dynamically created from the tools array

Env vars: SWML_ALLOW_CUSTOM_HANDLER_CODE must be set to "true" to enable handler execution.

tools
Record<string, unknown>[]

Array of custom tool definitions. Each object has:

  • name (string, required) — Unique tool name.
  • description (string, required) — Tool description shown to the AI.
  • handler_code (string, required) — JavaScript function body. Receives (args, rawData, FunctionResult) as arguments. Must return a FunctionResult, string, or object.
  • parameters (array, optional) — Parameter definitions: [{ name, type, description, required? }].
  • required (string[], optional) — Array of required parameter names.
  • prompt_description (string, optional) — Description to include in the prompt section.
  • secure (boolean, optional) — Whether to mark the tool as secure.
  • fillers (object, optional) — Filler phrases keyed by language.
prompt_title
stringDefaults to Custom Tools

Custom title for the prompt section.

prompt_body
string

Custom body text for the prompt section.

1import { AgentBase, CustomSkillsSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new CustomSkillsSkill({
7 tools: [
8 {
9 name: 'greet_user',
10 description: 'Greet the user by name.',
11 parameters: [
12 { name: 'name', type: 'string', description: 'The user name', required: true },
13 ],
14 required: ['name'],
15 handler_code: 'return new FunctionResult("Hello, " + args.name + "! Welcome.");',
16 },
17 ],
18}));
19
20agent.run();