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
      • BedrockAgent
      • CLI Tools
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
        • cleanup
        • define_tool
        • get_global_data
        • get_hints
        • get_instance_key
        • get_parameter_schema
        • get_prompt_sections
        • get_skill_data
        • register_tools
        • setup
        • update_skill_data
        • validate_env_vars
        • validate_packages
      • Skills
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
      • WebService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Returns
  • Example
AgentsSkillBase

cleanup

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

define_tool

Next
Built with

Called when the skill is removed or the agent shuts down. Override to release resources, close connections, cancel background tasks, etc.

Returns

None

Example

1from signalwire.core.skill_base import SkillBase
2
3class DatabaseSkill(SkillBase):
4 SKILL_NAME = "database"
5 SKILL_DESCRIPTION = "Database query skill"
6
7 def setup(self) -> bool:
8 self.connection = create_connection()
9 return True
10
11 def cleanup(self):
12 if hasattr(self, "connection"):
13 self.connection.close()
14 self.logger.info("Database connection closed")
15
16 def register_tools(self):
17 pass