Skip to main content
The Redis tool lets an agent read, write, and cache key-value data in Redis.

Overview

Redis tool allows you to interact with Redis for caching, key-value storage, and pub/sub messaging.

Installation

Environment Variables

Quick Start

1

Simple Usage

2

With Configuration

Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.

How It Works

Usage with Agent

Available Methods

get(key)

Get a value by key.

set(key, value, ttl=None)

Set a key-value pair with optional TTL.

delete(key)

Delete a key.

keys(pattern)

Find keys matching a pattern.

hget/hset

Hash operations.

Docker Setup

Common Errors

Best Practices

Read REDIS_PASSWORD from the environment instead of hard-coding it in the tool call.
set(key, value, ttl=3600) expires keys automatically. Use TTLs so agent-written cache entries do not grow unbounded.
Namespace keys (e.g. user:123:name) so agents can filter with keys(pattern) without scanning the whole store.

MongoDB

NoSQL database

PostgreSQL

SQL database

Upstash

Serverless Redis