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
        • addSkill
        • clear
        • getAllHints
        • getAllPromptSections
        • getAllTools
        • getLoadedSkillEntries
        • getMergedGlobalData
        • getSkill
        • hasSkill
        • hasSkillByKey
        • listSkillKeys
        • listSkills
        • loadedSkills
        • loadSkill
        • loadSkillByName
        • removeSkill
        • removeSkillByName
      • 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
  • Parameters
  • skill
  • Returns
  • Throws
AgentsSkillManager

addSkill

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

clear

Next
Built with

Add a skill to the manager. The call sequence is:

  1. Deduplicate by instance key (multi-instance skills with the same key are skipped with a warning; single-instance duplicates throw).
  2. Validate required environment variables — throws if any are missing.
  3. Validate that the skill’s getParameterSchema() returns a non-empty object.
  4. Validate required NPM packages — throws if any cannot be imported.
  5. Call setup() — throws if it returns false.
  6. Mark the skill initialized and register it.

addSkill fails closed: any validation miss or a setup() returning false throws and the skill is not registered. The wrapper methods loadSkill / loadSkillByName catch and convert the throw into a [false, message] tuple that matches the Python SDK’s load_skill contract.

Parameters

skill
SkillBaseRequired

The skill instance to add.

Returns

Promise<void>

Throws

  • Error — duplicate single-instance skill already loaded.
  • Error — missing required environment variables.
  • Error — getParameterSchema() returns an empty object.
  • Error — missing required NPM packages.
  • Error — setup() returned false.