Tools reference
Complete reference for all Agent Toolkit tools
This reference guide provides detailed information about all tools available in the Recall Agent Toolkit, including parameters, return values, and usage examples.
Account tools
Account tools allow agents to interact with Recall accounts, including viewing account information and managing credits.
get_account_info
Retrieves information about a Recall account, including token balances, address, and nonce.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
address | string | No | The address of the account to get information for. If not provided, uses the connected account. |
Returns
Example
get_credit_info
Gets credit information for the connected account, including available credits and used credits.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
address | string | No | The address of the account to get credit information for. If not provided, uses the connected account. |
Returns
Example
buy_credit
Buys credit for the connected account, allowing the agent to perform more operations on Recall.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
amount | string | Yes | The amount of credit to buy in ETH. |
to | string | No | The address of the account to buy credit for. If not provided, uses the connected account. |
Returns
Example
Bucket tools
Bucket tools allow agents to create, manage, and interact with storage buckets on Recall.
list_buckets
Lists all buckets owned by an address in Recall.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
address | string | No | The address of the account to list buckets for. If not provided, uses the connected account. |
Returns
Example
create_bucket
Creates a new bucket in Recall with the specified alias.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
bucketAlias | string | Yes | The alias to assign to the new bucket. |
metadata | object | No | Optional metadata to store with the bucket. |
Returns
Example
get_or_create_bucket
Gets an existing bucket by alias or creates a new one if it doesn't exist. This is often more convenient than separate get/create operations.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
bucketAlias | string | Yes | The alias of the bucket to retrieve or create. |
metadata | object | No | Optional metadata to store with the bucket if created. |
Returns
Example
add_object
Adds an object to a bucket in Recall. This is how agents store data persistently.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
bucket | string | Yes | The address of the bucket (0x...). |
key | string | Yes | The key under which to store the object. |
data | string | Uint8Array | Yes | The data to store. Most commonly a string or serialized JSON. |
metadata | object | No | Optional metadata to store with the object. |
overwrite | boolean | No | Whether to overwrite an existing object with the same key. Default is false. |
Returns
Example
get_object
Retrieves an object from a bucket in Recall. This is how agents retrieve previously stored data.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
bucket | string | Yes | The address of the bucket (0x...). |
key | string | Yes | The key under which the object is stored. |
outputType | string | No | The type of output to return: "string" (default) or "uint8array". |
Returns
Example
query_objects
Queries objects in a bucket based on prefix, delimiter, and other criteria. Useful for listing objects or finding objects with specific patterns.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
bucket | string | Yes | The address of the bucket (0x...). |
prefix | string | No | Filter objects that start with this prefix. |
delimiter | string | No | Character used to group objects (similar to directories). |
startKey | string | No | Start listing from this key (for pagination). |
limit | number | No | Maximum number of results to return. |
Returns
Example
Best practices
Error handling
When using the tools, implement proper error handling to make your agent more resilient:
Object storage patterns
For structured data, serialize to JSON before storing:
When retrieving, parse the JSON:
Naming conventions
Use consistent key naming patterns to organize data effectively:
- Hierarchical keys: Use slashes to create pseudo-directories:
users/123/profile
- Prefixes: Use consistent prefixes for related data:
user-123-preferences
,user-123-history
- Timestamps: Include timestamps in keys for time-series data:
logs-2023-04-01
Performance considerations
When working with the Agent Toolkit tools, consider these performance tips:
-
Batch operations: When storing multiple related objects, consider storing them as a single JSON object rather than multiple individual objects.
-
Lazy loading: Only retrieve data when needed rather than preemptively loading everything.
-
Caching: If repeatedly accessing the same data, cache it in memory rather than fetching it each time.
-
Pagination: Use the
limit
andstartKey
parameters when dealing with large numbers of objects.
For more complex scenarios or high-performance requirements, consider implementing a custom middleware that can optimize the API calls or implement caching.
Next steps
Now that you understand the available tools in the Agent Toolkit, you might want to:
- Check out the core concepts guide for a deeper understanding of the toolkit's architecture
- Learn about bucket monitoring to track your agent's storage
- Explore MCP integration for using the toolkit with MCP-compatible models