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
        • cleanup
        • defineTool
        • getAgent
        • getConfig
        • getDataMapTools
        • getGlobalData
        • getHints
        • getInstanceKey
        • getParameterSchema
        • getPromptSections
        • getSkillData
        • getSkillNamespace
        • getTools
        • hasAllEnvVars
        • hasAllPackages
        • isInitialized
        • markInitialized
        • setAgent
        • setup
        • updateSkillData
        • validateEnvVars
        • validatePackages
      • SkillManager
      • SkillRegistry
      • Skills
      • 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
  • Returns
  • Example — declarative override
  • Example — imperative via defineTool()
AgentsSkillBase

getTools

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

hasAllEnvVars

Next
Built with

Return the SWAIG tool definitions this skill exposes. Called by the SkillManager at SWML render time to collect every tool that should appear in the agent’s SWAIG block.

The default implementation returns tools registered imperatively via defineTool(). Skills that build their tool list declaratively should override this method to return a static array.

This replaces the Python register_tools() abstract method. TS uses a pull model: you return the list, rather than calling back into the agent once per tool.

Returns

SkillToolDefinition[] — array of tool definitions.

Example — declarative override

1import { SkillBase, type SkillToolDefinition } from '@signalwire/sdk';
2
3class WeatherSkill extends SkillBase {
4 static override SKILL_NAME = 'weather';
5 static override SKILL_DESCRIPTION = 'Provides weather information';
6
7 override getTools(): SkillToolDefinition[] {
8 return [{
9 name: 'get_weather',
10 description: 'Get current weather for a location',
11 parameters: {
12 location: { type: 'string', description: 'City name' },
13 },
14 required: ['location'],
15 handler: async (args) => ({ response: `Weather in ${args.location}: sunny, 72F` }),
16 }];
17 }
18}

Example — imperative via defineTool()

1class ConfigurableSkill extends SkillBase {
2 static override SKILL_NAME = 'configurable';
3 static override SKILL_DESCRIPTION = 'Tools depend on config';
4
5 override async setup(): Promise<boolean> {
6 this.defineTool({
7 name: this.getConfig('tool_name', 'run'),
8 description: this.getConfig('description', 'Run the action'),
9 parameters: {},
10 handler: async () => ({ response: 'done' }),
11 });
12 return true;
13 }
14}