figuard-mcp
v1.2.0Pre-flight spend authorization for AI agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
figuard_create_budget
Create a new FiGuard budget for an agent session. Returns a session_token that must be passed to figuard_authorize. The session_token is only returned once — store it for the duration of the agent session. Use currency (e.g. 'USD') for monetary budgets. Use unit (e.g. 'tokens') for resource budgets. Optionally add allocations to ring-fence spend by category (e.g. separate limits for flights and hotels). Pass external_reference to make this call idempotent: if a live budget with that reference already exists it is returned (HTTP 200) instead of creating a duplicate. If the reference exists bu…
| Parameter | Type | Description |
|---|---|---|
total_limit * | number | Maximum total amount the agent is allowed to spend. For USD budgets this is dollars, not cents. |
user_id * | string | Identifier for the user or agent session this budget belongs to. |
allocations | array | Optional category-level caps. Each allocation is an independent maximum — flights capped at $300 means flights can never exceed $300, regardless of what other categories spend. Allocation limits mus… |
anomaly_detection_enabled | boolean | When true, FiGuard monitors spend requests for statistical anomalies. Recommended for production. |
auto_pause_on_anomaly | boolean | Controls anomaly response mode. When true (default), an anomalous request pauses the budget — no further spend until a human resumes it. When false (advisory mode), the anomalous request is still de… |
currency | string | ISO 4217 currency code (e.g. 'USD', 'EUR'). Required for monetary budgets. Omit for resource budgets. |
expires_in | string | How long the budget is valid. Accepts '24h', '7d', '30m', or a number of seconds. Defaults to '24h'. |
external_reference | string | Optional stable identifier for this budget (e.g. 'run-abc-123', 'order-456'). When provided, re-calling figuard_create_budget with the same external_reference returns the existing live budget instead… |
intent_context | string | Optional human-readable description of what this budget is for (e.g. 'Book travel to NYC for user_123'). |
unit | string | Resource unit label (e.g. 'tokens', 'api_calls'). Required for resource budgets. Omit for monetary budgets. |
velocity_max_amount_per_hour | number | Max total requestedQuantity per rolling 1-hour window. |
velocity_max_per_day | number | Max authorize attempts per rolling 24-hour window. |
velocity_max_per_minute | number | Max authorize attempts per rolling 1-minute window. Denied with VELOCITY_LIMIT_EXCEEDED when exceeded. |
figuard_authorize
Pre-flight authorization — ask FiGuard if a spend is permitted before taking any action. Returns AUTHORIZED (with event_id) or DENIED (with denial_reason). Always call this before spending. Only proceed if the result is AUTHORIZED. The idempotency_key must be unique per logical spend intent — reuse the same key on retries so the same spend is never double-authorized. After the action succeeds call figuard_confirm; if it fails call figuard_fail. IMPORTANT: When the budget has allocations, pass the exact category string from the budget's allocation_categories field — do not use synonyms or…
| Parameter | Type | Description |
|---|---|---|
action_type * | string | Type of action being authorized (e.g. 'PURCHASE', 'REFUND', 'LLM_CALL', 'API_CALL'). |
agent_id * | string | Identifier for the agent making this request (e.g. 'booking-agent', 'refund-agent'). |
description * | string | Human-readable description of what the agent is about to do (e.g. 'Book NYC to LAX flight'). |
requested_quantity * | number | Amount to reserve. For USD budgets this is dollars. For token budgets this is the token count. |
session_token * | string | The session_token returned by figuard_create_budget. Never expose this in logs. |
claimed_category | string | Category of this spend (e.g. 'flight', 'hotel'). Required when the budget has allocations. |
claimed_item_type | string | Specific item type (e.g. 'economy_ticket', 'hotel_room'). Used for STRICT enforcement mode. |
dry_run | boolean | When true, runs all enforcement checks and returns AUTHORIZED/DENIED but writes nothing to the ledger. Use for testing. |
idempotency_key | string | Optional. Unique key for this spend intent. Use a UUID or stable identifier. Reuse on retries — never generate a new key for the same logical spend. When omitted, the SDK auto-generates a UUID v4 (s… |
parent_event_id | string | event_id of the parent spend if this is a sub-agent call. Used to build the causal chain. The parent event must be in AUTHORIZED or CONFIRMED state — passing a DENIED or VOIDED parent_event_id will… |
reserve | boolean | Optional (default true). Set false for an orchestrator/coordinator spend-tree root that should hold NO capacity and have no confirmation timeout — sub-agents authorize against the budget directly. U… |
trace_id | string | Optional run ID to link all events from a single agent run together for debugging. |
figuard_confirm
Confirm a previously authorized spend after the action succeeds. Pass the actual amount spent — it may differ from the authorized amount (e.g. authorized $340, flight cost $337.50). This releases the difference back to the budget. Always confirm after a successful action.
| Parameter | Type | Description |
|---|---|---|
confirmed_quantity * | number | Actual amount consumed. May be less than the authorized amount. |
event_id * | string | The event_id returned by figuard_authorize. |
external_transaction_id | string | Optional reference from your payment processor (e.g. Stripe charge ID) for audit purposes. |
figuard_fail
Mark an authorized spend as failed when the action did not succeed (e.g. payment processor declined, API error). This releases the reserved funds back to the budget so they can be used again.
| Parameter | Type | Description |
|---|---|---|
event_id * | string | The event_id returned by figuard_authorize. |
reason * | string | Short reason code for the failure (e.g. 'PAYMENT_DECLINED', 'API_ERROR', 'TOOL_ERROR'). |
error_message | string | Optional human-readable error detail for the audit log. |
figuard_void
Cancel an authorized reservation that was never used. Use this when the agent decides not to proceed with an action after authorizing it (e.g. user cancelled, better option found).
| Parameter | Type | Description |
|---|---|---|
event_id * | string | The event_id returned by figuard_authorize. |
reason * | string | Short reason for voiding (e.g. 'USER_CANCELLED', 'BETTER_OPTION_FOUND', 'PLAN_CHANGED'). |
void_child_events | boolean | When true, also void child events in the causal chain. Defaults to false. |
figuard_get_budget
Get the current state of a budget — total limit, amount spent, amount reserved, amount available, status, and per-category allocations. Use this to check remaining budget before planning an agent's actions.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID (starts with 'bgt_'). |
figuard_get_ledger
Query the authorization ledger for a budget — returns a paginated list of spend events (authorized, confirmed, denied, voided, failed). Use this to review what an agent has spent or to debug a denial.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID (starts with 'bgt_'). |
decision | string | Filter by event decision. Omit to return all events. |
page | number | Page number, zero-indexed. Defaults to 0. |
size | number | Events per page. Defaults to 20, max 100. |
trace_id | string | Filter by trace ID to see only events from a specific agent run. |
figuard_resume_budget
Resume a budget that was paused by anomaly detection or manually. A budget is paused when a spend request is statistically unusual (autoPauseOnAnomaly=true) or via PATCH /budgets/{id}. A human must review and provide an override reason before the budget can be used again. Requires override_reason explaining why the pause was reviewed and cleared.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID (starts with 'bgt_'). |
override_reason * | string | Required explanation for why the budget is being resumed (e.g. 'Reviewed — legitimate bulk purchase approved by ops team'). |
override_by | string | Optional identifier for the operator or system performing the override (e.g. 'ops-team', 'user_456'). |
figuard_extend_budget
Extend a budget's expiry window. Use this to keep a long-running agent alive past its original expiry. The new expiry must be later than the current one and at most 24 hours from now. Can be called repeatedly (e.g. extend by 2 hours every 2 hours for a 6-hour task). Returns 409 if the budget is CANCELLED or EXHAUSTED. Returns 400 if the new expiry is earlier than the current one.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID to extend. |
expires_at | string | Absolute ISO 8601 expiry timestamp. Mutually exclusive with expires_in. |
expires_in | string | Relative duration from now (e.g. '2h', '30m'). Mutually exclusive with expires_at. |
figuard_create_delegation_token
Create a scoped delegation token for a fleet budget. Each sub-agent (e.g. per-customer refund agent) gets its own token with per-category spend caps. The sub-agent calls figuard_authorize with this token exactly as it would with a normal session token — FiGuard enforces both the per-token caps and the fleet-level allocations transparently. The session_token is returned once — hand it to the sub-agent immediately and store it securely.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The fleet budget ID to delegate from. |
caps * | array | Per-category spend caps for this sub-agent. Only listed categories are cap-enforced at the delegation level. Categories not listed pass through to the fleet allocation only. |
label * | string | Human-readable label for this token, e.g. 'refund-agent-order-123'. |
figuard_revoke_delegation_token
Revoke a delegation token immediately. Any subsequent figuard_authorize call using this token will be rejected with INVALID_SESSION_TOKEN. Already-authorized events are not affected. Fires DELEGATION_TOKEN_REVOKED webhook. Idempotent.
| Parameter | Type | Description |
|---|---|---|
token_id * | string | The delegation token ID to revoke. |
figuard_get_delegation_token
Get the current state of a delegation token — label, status, per-category cap usage. The raw session_token is never returned, only the prefix.
| Parameter | Type | Description |
|---|---|---|
token_id * | string | The delegation token ID. |
figuard_cancel_batch
Cancel one or more budgets. Use this to cancel a single budget (pass one ID) or up to 100 at once. This is the correct tool when the user asks to cancel, close, void, or abandon a budget — not figuard_void (which only cancels individual spend events, not budgets). Already-terminal budgets (EXPIRED, CANCELLED, EXHAUSTED) are included in the response without an error — the call is idempotent per budget.
| Parameter | Type | Description |
|---|---|---|
budget_ids * | array | List of budget IDs to cancel. Maximum 100. |
figuard_fund_budget
Adjust a budget's totalLimit in-place without creating a new session. Use CREDIT to top up a nearly-exhausted budget mid-run, DEBIT to reduce it, RESET to set a new absolute limit, or RESET_SPENT to start a fresh billing period (zeroes quantitySpent and reactivates EXHAUSTED budgets). Returns the budget state before and after the operation.
| Parameter | Type | Description |
|---|---|---|
amount * | number | Amount to apply. Must be positive. |
budget_id * | string | ID of the budget to fund. |
operation * | string | CREDIT: add amount to totalLimit. DEBIT: subtract amount (rejected if result < quantitySpent). RESET: set totalLimit to exactly amount. RESET_SPENT: zero quantitySpent, set new totalLimit, reactivate… |
reason | string | Optional note recorded in the response for audit purposes. |
figuard_get_spend_tree
Get the hierarchical spend tree for a budget — every event and its causal children (parent → child chains). Use to inspect what an agent (and its sub-agents) actually spent, including denied attempts. Returns roots and a total event count.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID (starts with 'bgt_'). |
figuard_update_budget
Update an existing budget's settings: total limit, velocity caps, expiry, trust mode, or status. Use trust_mode='FULL_ENFORCEMENT' to leave shadow mode and start blocking, or 'SHADOW' to observe without blocking. For crediting/debiting funds with audit semantics, prefer figuard_fund_budget instead.
| Parameter | Type | Description |
|---|---|---|
budget_id * | string | The budget ID (starts with 'bgt_'). |
expires_at | string | New absolute ISO 8601 expiry (e.g. '2026-12-31T23:59:59Z'). |
status | string | Budget status override (advanced). |
total_limit | number | New total spend limit. |
trust_mode | string | 'SHADOW' (run all checks, block nothing) or 'FULL_ENFORCEMENT' (block denied spends). |
velocity_max_amount_per_hour | number | New per-hour amount cap. |
velocity_max_per_day | number | New per-day authorize cap. |
velocity_max_per_minute | number | New per-minute authorize cap. |