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
  • Parameters
  • Returns
  • Example
AgentsSkillBase

define_tool

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

get_global_data

Next
Built with

Register a tool with the parent agent, automatically merging any swaig_fields configured for this skill. Skills should use this method instead of calling self.agent.define_tool() directly.

Parameters

**kwargs
AnyRequired

All arguments supported by agent.define_tool(): name, description, parameters, handler, secure, fillers, wait_file, etc. Explicit values take precedence over swaig_fields.

Returns

None

Example

1from signalwire.core.skill_base import SkillBase
2from signalwire import FunctionResult
3
4class SearchSkill(SkillBase):
5 SKILL_NAME = "search"
6 SKILL_DESCRIPTION = "Search the web for information"
7
8 def setup(self) -> bool:
9 return True
10
11 def register_tools(self):
12 self.define_tool(
13 name="search_web",
14 description="Search the web for information",
15 handler=self._handle_search,
16 parameters={
17 "type": "object",
18 "properties": {
19 "query": {"type": "string", "description": "Search query"}
20 },
21 "required": ["query"]
22 },
23 secure=True,
24 fillers={"en-US": ["Let me search for that..."]}
25 )
26
27 def _handle_search(self, args, raw_data):
28 query = args.get("query", "")
29 return FunctionResult(f"Results for: {query}")