Agents

Skills

View as MarkdownOpen in Claude

Skills are pluggable capabilities that add tools to your agent. Add a skill with add_skill() and it registers one or more SWAIG functions automatically. Skills handle setup, parameter validation, and tool registration so you can add features like weather, search, or math with a single call.

from signalwire import AgentBase
class MyAgent(AgentBase):
def __init__(self):
super().__init__(name="my-agent")
self.set_prompt_text("You are a helpful assistant.")
# No-config skill
self.add_skill("datetime")
# Skill with parameters
self.add_skill("web_search", {
"api_key": "YOUR_KEY",
"search_engine_id": "YOUR_ENGINE_ID"
})
if __name__ == "__main__":
MyAgent().run()

Skills Summary

SkillFunctionsAPI RequiredMulti-Instance
datetime2NoNo
math1NoNo
web_search1YesYes
wikipedia_search1NoNo
weather_api1YesNo
joke1YesNo
play_background_file1NoYes
swml_transfer1NoYes
datasphere1YesYes
datasphere_serverless1YesYes
native_vector_search1NoYes
mcp_gatewayDynamicNoYes
google_maps2YesNo
info_gatherer2NoYes
claude_skillsDynamicNoYes
spider3NoYes
api_ninjas_trivia1YesYes

Configuration

All skills accept configuration via a dictionary passed to add_skill(). Skills can also read values from environment variables when a parameter defines an env_var fallback.

# Direct configuration
self.add_skill("web_search", {"api_key": "KEY", "search_engine_id": "ID"})
# Environment variable fallback
import os
self.add_skill("web_search", {
"api_key": os.getenv("GOOGLE_API_KEY"),
"search_engine_id": os.getenv("SEARCH_ENGINE_ID")
})

SWAIG Field Overrides

Override SWAIG function metadata for any skill by including a swaig_fields key:

from signalwire import AgentBase
class MyAgent(AgentBase):
def __init__(self):
super().__init__(name="assistant", route="/assistant")
self.set_prompt_text("You are a helpful assistant.")
self.add_skill("datetime", {
"swaig_fields": {
"fillers": {"en-US": ["Let me check the time...", "One moment..."]},
"secure": False
}
})
agent = MyAgent()
agent.serve()

Multi-Instance Skills

Skills that support multiple instances require unique tool_name values:

from signalwire import AgentBase
class MyAgent(AgentBase):
def __init__(self):
super().__init__(name="assistant", route="/assistant")
self.set_prompt_text("You are a helpful assistant.")
self.add_skill("native_vector_search", {
"tool_name": "search_products",
"index_file": "/data/products.swsearch"
})
self.add_skill("native_vector_search", {
"tool_name": "search_faqs",
"index_file": "/data/faqs.swsearch"
})
agent = MyAgent()
agent.serve()

Extending SkillBase

For creating custom skills, see SkillBase.