AgentsSkillBase

setup

View as MarkdownOpen in Claude

Initialize the skill: validate environment variables, check packages, initialize API clients, and prepare resources. Called once when the skill is loaded.

This is an abstract method — you must implement it in every SkillBase subclass.

Returns

boolTrue if setup succeeded, False to indicate the skill should not be loaded.

Example

import os
from signalwire.core.skill_base import SkillBase
class WeatherSkill(SkillBase):
SKILL_NAME = "weather"
SKILL_DESCRIPTION = "Provides weather information"
REQUIRED_PACKAGES = ["requests"]
REQUIRED_ENV_VARS = ["WEATHER_API_KEY"]
def setup(self) -> bool:
if not self.validate_packages():
return False
if not self.validate_env_vars():
return False
self.api_key = os.getenv("WEATHER_API_KEY")
return True
def register_tools(self):
pass # See register_tools page