write_kv_value
Store key-value data in Cloudflare Workers KV storage to persist application data, cache content, or manage configuration settings with optional expiration and metadata.
Instructions
Write a key-value pair to Workers KV storage. Can store text or metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No | Account ID (uses default from config if not provided) | |
| namespace_id | Yes | The KV namespace ID | |
| key | Yes | The key to write | |
| value | Yes | The value to store | |
| expiration_ttl | No | Number of seconds for the key to expire | |
| metadata | No | Arbitrary JSON metadata to store with the key |
Input Schema (JSON Schema)
{
"properties": {
"account_id": {
"description": "Account ID (uses default from config if not provided)",
"type": "string"
},
"expiration_ttl": {
"description": "Number of seconds for the key to expire",
"type": "number"
},
"key": {
"description": "The key to write",
"type": "string"
},
"metadata": {
"description": "Arbitrary JSON metadata to store with the key",
"type": "object"
},
"namespace_id": {
"description": "The KV namespace ID",
"type": "string"
},
"value": {
"description": "The value to store",
"type": "string"
}
},
"required": [
"namespace_id",
"key",
"value"
],
"type": "object"
}