> ## Documentation Index
> Fetch the complete documentation index at: https://agentictoolbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Crypto

> A tool for fetching cryptocurrency price information.

**class**: `JordanPrice\Toolbox\Tools\Crypto\CryptoTool`\
**env vars**: `None`\
**source**: [GitHub](https://github.com/jordan-price/toolbox/blob/main/src/Tools/Crypto/CryptoTool.php)

## Prism Integration

```php theme={null}
use JordanPrice\Toolbox\Tools\Crypto\CryptoTool;
use EchoLabs\Prism\Prism;
use EchoLabs\Prism\Enums\Provider;
use EchoLabs\Prism\Enums\ToolChoice;

$cryptoTool = new CryptoTool();

$prism = Prism::text()
    ->using(Provider::Anthropic, 'claude-3-5-sonnet-latest')
    ->withPrompt('What is the current price of Bitcoin?')
    ->withTools([$cryptoTool])  // Pass the tool instance
    ->toolChoice(ToolChoice::Any);

$response = $prism->generate();
```

## Publish

Optionally, you can publish the configuration file to make modifications:

```bash theme={null}
# Publish just this tool
php artisan toolbox:publish crypto

# Or publish all tools
php artisan toolbox:publish --all
```

## Methods

### \_\_invoke

Get cryptocurrency price information.

```php theme={null}
public function __invoke(string $coin, ?string $currency = 'usd'): string
```

#### Parameters

* `coin` (string): The cryptocurrency to get price for (e.g., BTC, ETH)
* `currency` (string): The currency to show price in (e.g., USD, EUR). Default is USD.

#### Returns

* `string`: Formatted price information
