Skip to content

Commit

Permalink
Merge pull request #1881 from crewAIInc/feat/improve-tool-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tonykipkemboi authored Jan 11, 2025
2 parents b8d07fe + 5dc8dd0 commit 3de81ce
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/concepts/tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,20 @@ There are two main ways for one to create a CrewAI tool:

```python Code
from crewai.tools import BaseTool
from pydantic import BaseModel, Field

class MyToolInput(BaseModel):
"""Input schema for MyCustomTool."""
argument: str = Field(..., description="Description of the argument.")

class MyCustomTool(BaseTool):
name: str = "Name of my tool"
description: str = "Clear description for what this tool is useful for, your agent will need this information to use it."
description: str = "What this tool does. It's vital for effective utilization."
args_schema: Type[BaseModel] = MyToolInput

def _run(self, argument: str) -> str:
# Implementation goes here
return "Result from custom tool"
# Your tool's logic here
return "Tool's result"
```

### Utilizing the `tool` Decorator
Expand Down

0 comments on commit 3de81ce

Please sign in to comment.