Redis
Connects directly to a Redis server over the RESP protocol (no external client library). An agent can get/set keys, manage lists and hashes, set expirations, and inspect server info.
Add to an agent node's tools array with _node_type: "tool-redis". See Connector Reference — How connectors are used.
Authentication
| Field | Required | Description |
|---|---|---|
host | No | Redis address as host:port. Defaults to localhost:6379. |
password | No | Password sent via AUTH before each command, if set. |
db | No | Redis logical database number. Defaults to 0. (Read from credentials but not currently used to select a database via SELECT.) |
{
"name": "redis",
"_node_type": "tool-redis",
"host": "{{ secret.REDIS_HOST }}",
"password": "{{ secret.REDIS_PASSWORD }}"
}
Tools
redis_get
Get a Redis key value.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Redis key to get |
Returns: The value of the key as a string, or (nil) if the key does not exist.
redis_set
Set a Redis key value with optional TTL.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Key to set |
value | string | Yes | Value to store |
ttl | number | No | Expiry in seconds (0 = no expiry) |
Returns: The Redis server reply (typically OK).
redis_del
Delete a Redis key.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Key to delete |
Returns: The number of keys removed, as a string.
redis_keys
Find Redis keys matching a pattern.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | Yes | Key pattern e.g. user:* or * for all |
Returns: A numbered list of matching keys (1) key\n2) key...), or (empty) if none match.
redis_incr
Increment a Redis numeric key by N (default 1).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Key to increment |
by | number | No | Amount to add (default 1) |
Returns: The key's new integer value as a string.
redis_expire
Set a TTL (expiry) on an existing key.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Key to expire |
ttl | number | Yes | Expiry in seconds |
Returns: 1 if the timeout was set, 0 if the key does not exist.
redis_list_push
Push a value onto a Redis list (left or right).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | List key |
value | string | Yes | Value to push |
direction | string | No | left or right (default right) |
Returns: The new length of the list as a string.
redis_list_range
Get a range of elements from a Redis list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | List key |
start | number | No | Start index |
stop | number | No | End index (-1 for all; 0 is treated as -1) |
Returns: A numbered list of the list's elements in the requested range.
redis_hash
Get or set a Redis hash field. Leave field empty to get all fields (HGETALL).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Hash key |
field | string | No | Field name (empty = get all) |
value | string | No | Value to set (empty = get) |
Returns: If value is set, the result of HSET; else if field is set, the field's value (HGET); else all fields and values (HGETALL).
redis_info
Get Redis server info and statistics.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
section | string | No | Info section: server, clients, memory, stats, replication (empty = all) |
Returns: The raw text output of the Redis INFO command.