***

title: define_tool
slug: /reference/python/agents/skill-base/define-tool
description: Register a tool with automatic swaig_fields merging.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

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**

<ParamField path="**kwargs" type="Any" required={true} toc={true}>
  All arguments supported by `agent.define_tool()`: `name`, `description`,
  `parameters`, `handler`, `secure`, `fillers`, `wait_file`, etc. Explicit
  values take precedence over `swaig_fields`.
</ParamField>

## **Returns**

`None`

## **Example**

```python {12}
from signalwire.core.skill_base import SkillBase
from signalwire import FunctionResult

class SearchSkill(SkillBase):
    SKILL_NAME = "search"
    SKILL_DESCRIPTION = "Search the web for information"

    def setup(self) -> bool:
        return True

    def register_tools(self):
        self.define_tool(
            name="search_web",
            description="Search the web for information",
            handler=self._handle_search,
            parameters={
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "Search query"}
                },
                "required": ["query"]
            },
            secure=True,
            fillers={"en-US": ["Let me search for that..."]}
        )

    def _handle_search(self, args, raw_data):
        query = args.get("query", "")
        return FunctionResult(f"Results for: {query}")
```