Skip to content

Commit c440cf5

Browse files
authored
Enhance documentation for Tool::make usage (#763)
1 parent 5b2c768 commit c440cf5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/core-concepts/tools-function-calling.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,26 @@ class SearchTool extends Tool
285285
}
286286
```
287287

288+
You can use `Tool::make($className)` if you need to resolve the dependencies:
289+
290+
291+
```php
292+
use App\Tools\SearchTool;
293+
use Prism\Prism\Facades\Tool;
294+
295+
$tool = Tool::make(SearchTool::class);
296+
```
297+
298+
## Using Laravel MCP Tools
299+
You can use existing [Laravel MCP](https://github.com/laravel/mcp) Tools in Prism directly, without using the Laravel MCP Server:
300+
301+
```php
302+
use App\Mcp\Tools\CurrentWeatherTool;
303+
use Prism\Prism\Facades\Tool;
304+
305+
$tool = Tool::make(CurrentWeatherTool::class);
306+
```
307+
288308
## Tool Choice Options
289309

290310
You can control how the AI uses tools with the `withToolChoice` method:

0 commit comments

Comments
 (0)