> For the complete documentation index, see [llms.txt](https://docs.rigoblock.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rigoblock.com/tools.md).

# Tools

Direct tool invocation without LLM overhead — structured input/output

## List all available DeFi tools with schemas

> Returns a machine-readable catalog of every direct-invocation tool: names, descriptions, parameter schemas, categories, and access requirements.\
> \
> Autonomous agents should call this endpoint first to discover what operations are available and what arguments each tool expects. The response includes full JSON-Schema parameter definitions compatible with OpenAI function calling.\
> \
> \*\*Price:\*\* $0.0024 USDC per request (x402, eip155:8453)

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"tags":[{"name":"Tools","description":"Direct tool invocation without LLM overhead — structured input/output"}],"servers":[{"url":"https://trader.rigoblock.com","description":"Production"}],"security":[{"x402":[]}],"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-Payment","description":"x402 payment header. Flow:\n1. Make the request without this header → receive `402 Payment Required` and, for protected routes, a `PAYMENT-REQUIRED` header describing accepted payment requirements\n2. Create the x402 payment payload for USDC on Base (chain 8453), typically via `@x402/core` and the CDP facilitator at `api.cdp.coinbase.com`\n3. Retry the request with this header set to the encoded payment payload\n\nSuccessful 2xx responses may include a `PAYMENT-RESPONSE` settlement receipt. See https://github.com/rigoblock/agentic-operator/blob/main/AGENTS.md for full integration."}},"schemas":{"ToolCatalogResponse":{"type":"object","required":["description","usage","price","toolCount","tools"],"properties":{"description":{"type":"string"},"usage":{"type":"string"},"price":{"type":"string"},"toolCount":{"type":"integer","description":"Total number of tools in the catalog"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolDefinition"}}}},"ToolDefinition":{"type":"object","description":"OpenAI-compatible function schema for a single DeFi tool","required":["name","description","category","parameters","requiresOperatorAuth","readOnly"],"properties":{"name":{"type":"string","description":"Canonical tool name used in POST /api/tools?toolName={name}"},"description":{"type":"string","description":"What the tool does and when to use it"},"category":{"type":"string","description":"Functional group","enum":["Spot Trading","Vault Info","GMX Perpetuals","Uniswap v4 LP","Cross-Chain","GRG Staking","Vault Management","Delegation","TWAP Orders","NAV Sync","Operator Settings","Oracle","Strategy","Other"]},"parameters":{"type":"object","description":"JSON Schema for the tool's arguments object"},"requiresOperatorAuth":{"type":"boolean","description":"If true, the tool can only be invoked when the request includes a valid operator signature"},"readOnly":{"type":"boolean","description":"If true, the tool only reads data and never produces transaction calldata"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}},"paths":{"/api/tools":{"get":{"operationId":"listTools","summary":"List all available DeFi tools with schemas","description":"Returns a machine-readable catalog of every direct-invocation tool: names, descriptions, parameter schemas, categories, and access requirements.\n\nAutonomous agents should call this endpoint first to discover what operations are available and what arguments each tool expects. The response includes full JSON-Schema parameter definitions compatible with OpenAI function calling.\n\n**Price:** $0.0024 USDC per request (x402, eip155:8453)","tags":["Tools"],"responses":{"200":{"description":"Tool catalog with full schemas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCatalogResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"x402 payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}}}}}}}
```

## Invoke a DeFi tool directly

> Direct tool invocation without LLM overhead. Useful when you know exactly which operation to perform and want structured input/output without natural language parsing. Each call is atomic.\
> \
> \*\*Discover schemas first:\*\* Call \`GET /api/tools\` to retrieve the full catalog with parameter schemas for every tool.\
> \
> \*\*Price:\*\* $0.0025 USDC per request (x402, eip155:8453)\
> \
> \*\*Read-only tools:\*\*\
> \`get\_swap\_quote\`, \`get\_vault\_info\`, \`get\_token\_balance\`, \`get\_pool\_info\`, \`get\_lp\_positions\`, \`gmx\_get\_positions\`, \`gmx\_get\_markets\`, \`check\_delegation\_status\`, \`get\_crosschain\_quote\`, \`get\_aggregated\_nav\`, \`get\_rebalance\_plan\`, \`verify\_bridge\_arrival\`, \`list\_twap\_orders\`, \`list\_nav\_syncs\`, \`list\_strategies\`, \`switch\_chain\`\
> \
> \*\*State-changing tools:\*\*\
> \`build\_vault\_swap\`, \`add\_liquidity\`, \`remove\_liquidity\`, \`collect\_lp\_fees\`, \`burn\_position\`, \`gmx\_increase\_position\`, \`gmx\_decrease\_position\`, \`gmx\_cancel\_order\`, \`gmx\_update\_order\`, \`gmx\_claim\_funding\_fees\`, \`crosschain\_transfer\`, \`crosschain\_sync\`, \`grg\_stake\`, \`grg\_unstake\`, \`grg\_undelegate\_stake\`, \`grg\_end\_epoch\`, \`grg\_claim\_rewards\`, \`deploy\_smart\_pool\`, \`fund\_pool\`, \`create\_twap\_order\`, \`cancel\_twap\_order\`, \`create\_nav\_sync\`, \`cancel\_nav\_sync\`\
> \
> \*\*Operator-scoped tools (require operatorVerified):\*\*\
> \`setup\_delegation\`, \`revoke\_delegation\`, \`revoke\_selectors\`, \`list\_strategies\`, \`set\_default\_slippage\`, \`set\_swap\_shield\_tolerance\`, \`enable\_swap\_shield\`\
> \
> \*\*Oracle tools:\*\*\
> \`refresh\_oracle\_feed\`\
> \
> \*\*Orchestration pattern:\*\* External agents compose atomic operations from this endpoint into multi-step strategies. Each call returns either a result (reads) or unsigned calldata (writes). The full safety stack (NAV shield, Swap Shield, slippage protection) applies to all write operations.

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"tags":[{"name":"Tools","description":"Direct tool invocation without LLM overhead — structured input/output"}],"servers":[{"url":"https://trader.rigoblock.com","description":"Production"}],"security":[{"x402":[]}],"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-Payment","description":"x402 payment header. Flow:\n1. Make the request without this header → receive `402 Payment Required` and, for protected routes, a `PAYMENT-REQUIRED` header describing accepted payment requirements\n2. Create the x402 payment payload for USDC on Base (chain 8453), typically via `@x402/core` and the CDP facilitator at `api.cdp.coinbase.com`\n3. Retry the request with this header set to the encoded payment payload\n\nSuccessful 2xx responses may include a `PAYMENT-RESPONSE` settlement receipt. See https://github.com/rigoblock/agentic-operator/blob/main/AGENTS.md for full integration."}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}},"paths":{"/api/tools":{"post":{"operationId":"invokeTool","summary":"Invoke a DeFi tool directly","description":"Direct tool invocation without LLM overhead. Useful when you know exactly which operation to perform and want structured input/output without natural language parsing. Each call is atomic.\n\n**Discover schemas first:** Call `GET /api/tools` to retrieve the full catalog with parameter schemas for every tool.\n\n**Price:** $0.0025 USDC per request (x402, eip155:8453)\n\n**Read-only tools:**\n`get_swap_quote`, `get_vault_info`, `get_token_balance`, `get_pool_info`, `get_lp_positions`, `gmx_get_positions`, `gmx_get_markets`, `check_delegation_status`, `get_crosschain_quote`, `get_aggregated_nav`, `get_rebalance_plan`, `verify_bridge_arrival`, `list_twap_orders`, `list_nav_syncs`, `list_strategies`, `switch_chain`\n\n**State-changing tools:**\n`build_vault_swap`, `add_liquidity`, `remove_liquidity`, `collect_lp_fees`, `burn_position`, `gmx_increase_position`, `gmx_decrease_position`, `gmx_cancel_order`, `gmx_update_order`, `gmx_claim_funding_fees`, `crosschain_transfer`, `crosschain_sync`, `grg_stake`, `grg_unstake`, `grg_undelegate_stake`, `grg_end_epoch`, `grg_claim_rewards`, `deploy_smart_pool`, `fund_pool`, `create_twap_order`, `cancel_twap_order`, `create_nav_sync`, `cancel_nav_sync`\n\n**Operator-scoped tools (require operatorVerified):**\n`setup_delegation`, `revoke_delegation`, `revoke_selectors`, `list_strategies`, `set_default_slippage`, `set_swap_shield_tolerance`, `enable_swap_shield`\n\n**Oracle tools:**\n`refresh_oracle_feed`\n\n**Orchestration pattern:** External agents compose atomic operations from this endpoint into multi-step strategies. Each call returns either a result (reads) or unsigned calldata (writes). The full safety stack (NAV shield, Swap Shield, slippage protection) applies to all write operations.","tags":["Tools"],"parameters":[{"name":"toolName","in":"query","required":true,"description":"Tool name to invoke","schema":{"type":"string","enum":["get_swap_quote","build_vault_swap","get_vault_info","get_token_balance","switch_chain","gmx_increase_position","gmx_decrease_position","gmx_get_positions","gmx_cancel_order","gmx_update_order","gmx_claim_funding_fees","gmx_get_markets","setup_delegation","revoke_delegation","check_delegation_status","deploy_smart_pool","fund_pool","crosschain_transfer","crosschain_sync","get_crosschain_quote","get_aggregated_nav","get_rebalance_plan","list_strategies","get_pool_info","add_liquidity","remove_liquidity","get_lp_positions","collect_lp_fees","burn_position","grg_stake","grg_unstake","grg_undelegate_stake","grg_end_epoch","grg_claim_rewards","revoke_selectors","verify_bridge_arrival","set_default_slippage","set_swap_shield_tolerance","enable_swap_shield","create_twap_order","cancel_twap_order","list_twap_orders","create_nav_sync","list_nav_syncs","cancel_nav_sync","refresh_oracle_feed"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["arguments"],"properties":{"arguments":{"type":"object","description":"Tool-specific arguments. For swap tools, provide `tokenIn`, `tokenOut`, and either `amountIn` or `amountOut`. Other tools use different argument shapes.","additionalProperties":true},"chainId":{"type":"integer","description":"EVM chain ID","default":8453,"enum":[1,10,56,137,130,8453,42161]},"vaultAddress":{"type":"string","description":"Rigoblock vault address (required for vault-specific tools)"},"operatorAddress":{"type":"string","description":"Vault owner address (required for vault-action tools in delegated mode)"},"authSignature":{"type":"string","description":"EIP-191 signature by operatorAddress over the auth message (required for vault-action tools)"},"authTimestamp":{"type":"integer","description":"Unix timestamp (ms) when authSignature was created. Valid for 24 hours."}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string","description":"Canonical tool name that handled the request"},"message":{"type":"string","description":"Human-readable tool result"},"transaction":{"type":"object","description":"Unsigned transaction payload for state-changing tools"},"chainSwitch":{"type":"integer","description":"Suggested chain switch, when the tool resolved to a different chain"},"suggestions":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Bad request — missing or invalid arguments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Operator authentication required for this tool","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"x402 payment required","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded payment requirements","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}},"404":{"description":"Unknown tool name","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rigoblock.com/tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
