Skip to main content
Glama

Cloudflare: Put kv value

cloudflare_put_kv_value
Destructive

Writes a value to a key in Cloudflare Workers KV, creating the key if missing; optionally set an absolute expiration timestamp or a TTL in seconds.

Instructions

[UNIFIED] Write a KV value for a key (Workers KV Storage Edit permission). Creates the key if it does not exist. Optionally set expiration (absolute Unix timestamp) or expiration_ttl (seconds from now).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "namespace_id": "<namespace_id>",
      "key_name": "<key_name>",
      "value": "<value>"
    },
    "name": "cloudflare_put_kv_value"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYes
valueYes
key_nameYes
account_idNo
expirationNo
namespace_idYes
expiration_ttlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and idempotentHint=false; the description adds real value by disclosing the upsert behavior ("Creates the key if it does not exist"). It does not, however, warn that an existing value is overwritten and lost, which is the core risk implied by destructiveHint=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the action and followed by behavioral and parameter details. The "[UNIFIED]" prefix is metadata noise, but nothing else is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and 0% schema description coverage across seven parameters, the description should carry more weight. It covers the mutation semantics and the two expiration fields well, but leaves the required/optional identifiers (site, account_id, namespace_id) undefined, which is a meaningful gap for a tool an agent may call blindly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description has to compensate. It usefully disambiguates the two expiration parameters ("absolute Unix timestamp" vs "seconds from now"), but leaves site, account_id, and namespace_id entirely unexplained, so three of seven parameters remain opaque.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ("Write a KV value for a key") and adds the storage product (Workers KV), so the agent knows exactly what mutation occurs. It is distinct from the get/delete/list KV siblings in the surrounding catalog, though it does not name them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the required permission ("Workers KV Storage Edit permission"), which is useful pre-call context, but gives no explicit when-to-use vs when-not guidance and never points to alternatives such as the delete or get siblings. Usage is implied rather than directed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools