Skip to main content
Glama
ry-ops

Cloudflare MCP Server

by ry-ops

delete_kv_value

Remove a key-value pair from Cloudflare Workers KV storage by specifying the namespace and key.

Instructions

Delete a key from Workers KV storage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNoAccount ID (uses default from config if not provided)
namespace_idYesThe KV namespace ID
keyYesThe key to delete

Implementation Reference

  • The actual handler function _delete_kv_value that executes the delete logic: extracts account_id, builds the API URL, and performs a DELETE request to the Cloudflare KV API.
    async def _delete_kv_value(self, args: dict) -> str:
        """Delete KV value."""
        account_id = args.get("account_id") or self.account_id
        if not account_id:
            raise ValueError("Account ID is required. Provide it in args or config.")
    
        url = f"{CLOUDFLARE_API_BASE}/accounts/{account_id}/storage/kv/namespaces/{args['namespace_id']}/values/{args['key']}"
        headers = {"Authorization": f"Bearer {self.api_token}"}
    
        response = await self.client.delete(url, headers=headers)
        response.raise_for_status()
    
        return "KV value deleted successfully"
  • The Tool definition and inputSchema for delete_kv_value, specifying required parameters: namespace_id and key, with optional account_id.
    Tool(
        name="delete_kv_value",
        description="Delete a key from Workers KV storage",
        inputSchema={
            "type": "object",
            "properties": {
                "account_id": {
                    "type": "string",
                    "description": "Account ID (uses default from config if not provided)",
                },
                "namespace_id": {
                    "type": "string",
                    "description": "The KV namespace ID",
                },
                "key": {"type": "string", "description": "The key to delete"},
            },
            "required": ["namespace_id", "key"],
        },
    ),
  • The call_tool handler routing: matches the name 'delete_kv_value' and dispatches to the _delete_kv_value method.
    elif name == "delete_kv_value":
        result = await self._delete_kv_value(arguments)
Behavior2/5

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

The description says 'Delete' but lacks behavioral details such as whether the operation is irreversible, required permissions, or what happens if the key does not exist. With no annotations, the description carries full burden but provides minimal disclosure.

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

Conciseness5/5

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

The description is one sentence, directly front-loading the purpose. Every word is necessary, with no redundancy. Ideal conciseness.

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?

For a simple delete operation with three parameters, the description covers the basic purpose but omits important context: behavior on missing key, error states, immediacy of deletion, and any side effects. It is adequate but not fully complete.

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 coverage is 100%, so the schema already documents all parameters. The description adds nothing beyond what the schema provides. According to guidelines, high coverage gives a baseline of 3, and no extra value is added.

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

Purpose5/5

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

The description clearly states 'Delete a key from Workers KV storage', specifying the action (delete) and the resource (Workers KV key). It effectively distinguishes from sibling tools like read_kv_value and write_kv_value.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For example, it does not mention that deletion is permanent or suggest using list_kv_keys first. Context about prerequisites or consequences is absent.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ry-ops/cloudflare-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server