PHPackages                             bear/tool-use - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bear/tool-use

ActiveLibrary

bear/tool-use
=============

LLM Tool Use support for BEAR.Sunday applications

0.1.0(3d ago)01↑2900%MITPHPPHP ^8.2CI passing

Since Mar 19Pushed 3d agoCompare

[ Source](https://github.com/bearsunday/BEAR.ToolUse)[ Packagist](https://packagist.org/packages/bear/tool-use)[ RSS](/packages/bear-tool-use/feed)WikiDiscussions 1.x Synced today

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

BEAR.ToolUse
============

[](#beartooluse)

A library that enables AI agent capabilities for BEAR.Sunday applications.

Automatically generates Tool Use definitions from resource classes and manages the agent loop with LLMs.

Features
--------

[](#features)

- Auto-generates JSON Schema-based tool definitions from resource classes
- Enhances parameter descriptions using JSON Schema, ALPS profiles, and PHPDoc
- Controls tool exposure via `#[Tool]` and `#[Exclude]` attributes
- URI-based resource specification (`app://self/user`, `page://self/article`)
- LLM-agnostic design (provides interfaces only)

Requirements
------------

[](#requirements)

- PHP 8.2+
- BEAR.Sunday

Installation
------------

[](#installation)

```
composer require bear/tool-use
```

Usage
-----

[](#usage)

### 1. Define Resource Classes

[](#1-define-resource-classes)

```
