Upstash
Serverless Redis with Upstash
Connect to Upstash Redis to perform key-value, hash, list, and utility operations via the REST API.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was retrieved |
value | json | The value of the key (string), or null if not found |
Set the value of a key in Upstash Redis with an optional expiration time in seconds.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
value | string | Yes | No description |
ex | number | No | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was set |
result | string | The result of the SET operation (typically "OK") |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was deleted |
deletedCount | number | Number of keys deleted (0 if key did not exist, 1 if deleted) |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
pattern | string | No | Pattern to match keys (e.g., "user:"). Defaults to "" for all keys. |
| Parameter | Type | Description |
|---|
pattern | string | The pattern used to match keys |
keys | array | List of keys matching the pattern |
count | number | Number of keys found |
Execute an arbitrary Redis command against Upstash Redis. Pass the full command as a JSON array (e.g., [
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
command | string | Yes | Redis command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]) or a simple command string (e.g., "PING") |
| Parameter | Type | Description |
|---|
command | string | The command that was executed |
result | json | The result of the Redis command |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
field | string | Yes | No description |
value | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | key output from the tool |
field | string | The field that was set |
result | number | Number of new fields added (0 if field was updated, 1 if new) |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
field | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | key output from the tool |
field | string | The field that was retrieved |
value | json | The value of the hash field (string), or null if not found |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | key output from the tool |
fields | object | All field-value pairs in the hash, keyed by field name |
fieldCount | number | Number of fields in the hash |
Atomically increment the integer value of a key by one in Upstash Redis. If the key does not exist, it is set to 0 before incrementing.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was incremented |
value | number | The new value after incrementing |
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
seconds | number | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that expiration was set on |
result | number | 1 if the timeout was set, 0 if the key does not exist |
Get the remaining time to live of a key in Upstash Redis. Returns -1 if the key has no expiration, -2 if the key does not exist.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key checked |
ttl | number | Remaining TTL in seconds. Positive integer if the key has a TTL set, -1 if the key exists with no expiration, -2 if the key does not exist. |
Prepend a value to the beginning of a list in Upstash Redis. Creates the list if it does not exist.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
value | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | key output from the tool |
length | number | The length of the list after the push |
Get a range of elements from a list in Upstash Redis. Use 0 and -1 for start and stop to get all elements.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
start | number | Yes | No description |
stop | number | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | key output from the tool |
values | array | List of elements in the specified range |
count | number | Number of elements returned |
Check if a key exists in Upstash Redis. Returns true if the key exists, false otherwise.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was checked |
exists | boolean | Whether the key exists (true) or not (false) |
Set the value of a key only if it does not already exist. Returns true if the key was set, false if it already existed.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
value | string | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was attempted to set |
wasSet | boolean | Whether the key was set (true) or already existed (false) |
Increment the integer value of a key by a given amount. Use a negative value to decrement. If the key does not exist, it is set to 0 before the operation.
| Parameter | Type | Required | Description |
|---|
restUrl | string | Yes | No description |
restToken | string | Yes | No description |
key | string | Yes | No description |
increment | number | Yes | No description |
| Parameter | Type | Description |
|---|
key | string | The key that was incremented |
value | number | The new value after incrementing |