Tools & Remote Config
Register tool metadata once at startup, then tune retries, budgets, and timeouts per tool from the dashboard. Changes propagate to the SDK within 30 seconds without redeployment.
Register at startup
import { configure, registerTools } from 'fuze-ai'
configure({
cloud: { apiKey: process.env.FUZE_API_KEY },
project: { projectId: 'my-agent' },
})
registerTools([
{
name: 'search',
description: 'Vector database search over company docs',
sideEffect: false,
defaults: { maxRetries: 3, maxBudget: 0.10, timeout: 10_000 },
},
{
name: 'sendEmail',
description: 'Send transactional email via SES',
sideEffect: true,
defaults: { maxRetries: 1, maxBudget: 0.02, timeout: 8_000 },
},
])Call this once during application startup, before any agents run. If no API key is configured, registerTools() is a no-op, nothing breaks.
Tool name matching
The name in registerTools() must match the function name that guard() wraps. Fuze uses fn.name automatically:
registerTools() API
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Function name, must match fn.name in guard() |
description | string | , | Human-readable description shown in the dashboard |
schema | object | , | JSON Schema of the function's parameters |
sideEffect | boolean | ✅ | Whether the tool modifies external state |
defaults.maxRetries | number | ✅ | Default retry count (editable from dashboard) |
defaults.maxBudget | number | ✅ | Default USD budget cap per call (editable from dashboard) |
defaults.timeout | number | ✅ | Default timeout in ms (editable from dashboard) |
How remote config works
Override precedence
The tighter limit always wins:
| Level | Applied |
|---|---|
guard(fn, { maxCost: X }) | Highest, never overridden remotely |
Dashboard maxBudget | Takes minimum of local and remote |
Dashboard maxRetries / timeout | Replaces local values entirely |
defaults in registerTools() | Baseline, used when dashboard hasn't been configured |
fuze.toml / configure() | Global baseline |
Disabling a tool remotely
Set enabled: false for a tool in the dashboard. Any call to that tool will immediately throw a FuzeError, no LLM request is made, and the error propagates to your agent for handling:
This is useful for emergency stops: if a tool is causing unexpected costs or failures, disable it from the dashboard without a deployment.
Without an API key
registerTools() is always safe to call. When no FUZE_API_KEY is set:
- The call is a no-op, no network request is made
guard()uses local defaults fromfuze.tomland per-function options- All protection logic (budget, loop detection, tracing) works exactly as normal
- Dashboard tool configuration simply isn't available