Skip to content

Commit 90a581a

Browse files
authored
docs: add tools section (#1)
1 parent 5bfd6bf commit 90a581a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,23 @@ final readonly class McpController
9696
}
9797
}
9898
```
99+
100+
### Exposing Tools
101+
102+
Under the hood the SDK uses [LLM Chain](https://github.com/php-llm/llm-chain)'s `ToolBox` to register, analyze and
103+
execute tools. In combination with its [Symfony Bundle](https://github.com/php-llm/llm-chain-bundle) you can expose
104+
tools with `#[AsTool]` attribute.
105+
106+
```php
107+
use PhpLlm\LlmChain\ToolBox\Attribute\AsTool;
108+
109+
#[AsTool('company_name', 'Provides the name of your company')]
110+
final class CompanyName
111+
{
112+
public function __invoke(): string
113+
{
114+
return 'ACME Corp.'
115+
}
116+
}
117+
```
118+
See [LLM Chain Documentation](https://github.com/php-llm/llm-chain?tab=readme-ov-file#tools) for more information.

0 commit comments

Comments
 (0)