cache_set
Store a key-value pair in a running cache instance with optional TTL. Overwrites existing values and returns success status.
Instructions
Set a key-value pair in a running cache instance. Overwrites any existing value at the key — not idempotent for new data. Returns "OK" on success; returns an error if the instance_id is invalid or the instance is paused. Value can be a string or a JSON-serialized object. Optionally set a TTL in seconds (omit for no expiry). Use cache_mset instead for setting multiple keys in a single pipeline round-trip. Use cache_stream_set instead for caching LLM token streams (ordered string chunks).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance_id | Yes | UUID of the cache instance (from list_instances) | |
| key | Yes | Cache key | |
| value | Yes | Value to store (string or JSON) | |
| ttl | No | Time-to-live in seconds (optional, omit for no expiry) |