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.

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="my-agent")
6 self.set_prompt_text("You are a helpful assistant.")
7
8 # No-config skill
9 self.add_skill("datetime")
10
11 # Skill with parameters
12 self.add_skill("web_search", {
13 "api_key": "YOUR_KEY",
14 "search_engine_id": "YOUR_ENGINE_ID"
15 })
16
17if __name__ == "__main__":
18 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.

1# Direct configuration
2self.add_skill("web_search", {"api_key": "KEY", "search_engine_id": "ID"})
3
4# Environment variable fallback
5import os
6self.add_skill("web_search", {
7 "api_key": os.getenv("GOOGLE_API_KEY"),
8 "search_engine_id": os.getenv("SEARCH_ENGINE_ID")
9})

SWAIG Field Overrides

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

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("datetime", {
8 "swaig_fields": {
9 "fillers": {"en-US": ["Let me check the time...", "One moment..."]},
10 "secure": False
11 }
12 })
13
14agent = MyAgent()
15agent.serve()

Multi-Instance Skills

Skills that support multiple instances require unique tool_name values:

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("native_vector_search", {
8 "tool_name": "search_products",
9 "index_file": "/data/products.swsearch"
10 })
11 self.add_skill("native_vector_search", {
12 "tool_name": "search_faqs",
13 "index_file": "/data/faqs.swsearch"
14 })
15
16agent = MyAgent()
17agent.serve()

Extending SkillBase

For creating custom skills, see SkillBase.