Skip to main content
Glama

mcp-cloudflare-api__execute

Destructive

Execute JavaScript code that can read, create, update, or delete resources through the Cloudflare API. First use the 'search' tool to find the right endpoints, then write code using the cloudflare.request() function.

Available in your code:

interface CloudflareRequestOptions { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; path: string; query?: Record<string, string | number | boolean | undefined>; // Objects and arrays are sent as JSON. Bytes (Uint8Array, ArrayBuffer), Blob, FormData, // URLSearchParams, streams, and strings with a non-JSON contentType are sent as they are. A string // with a JSON contentType, or none, is sent as it is when it is already JSON, else as a JSON string. body?: unknown; // Content-Type header. Defaults to application/json for JSON bodies. Leave it unset for FormData, // whose multipart boundary fetch adds. contentType?: string; }

// The response body as the API sends it. Most APIs wrap it in this envelope; a few send their JSON // bare (the spec's re… Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then. This connection has no undo; Royally recorded the change but cannot reverse it.

Input Schema

NameRequiredDescriptionDefault
codeYesJavaScript async arrow function to execute
site_idNoSite to run this tool on: bb028350-9e3e-46c0-bea7-cd6c2dedf060 (https://mcp.cloudflare.com/mcp)
truncateNoCap the result at ~6,000 tokens. Set to false only when the result goes straight to a file or pipe, not into the conversation: without the cap, a broad query can return megabytes.
account_idNoCloudflare account ID to run against. Optional when the session is authorized for exactly one account, and for account-independent calls such as GET /accounts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructive=true, readOnly=false, and non-idempotent, but the description adds genuinely new context: changes wait for a human to approve them in Royally and nothing changes until then, and the connection has no undo. The response-envelope explanation is truncated mid-sentence ('the spec's re…'), leaving the return shape only partly disclosed.

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

Conciseness3/5

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

The critical instruction is front-loaded, which is good, but the body is padded by a long interface block and then visibly corrupted: a sentence cut off at 'the spec's re…' spliced into unrelated 'Through Royally:' approval text. The garbling costs real comprehension, so the structure is only adequate.

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

Completeness4/5

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

For a destructive, open-world code-execution tool with no output schema, the definition covers the essentials: the request helper signature, the response envelope (in truncated form), the approval gate, no-undo, and output truncation. The broken response-envelope sentence is the one real hole an agent would want filled.

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%, and the schema itself already explains truncate, account_id, and site_id well, so the baseline of 3 applies. The TypeScript block adds meaning about what the `code` payload can call (method/path/query/body/contentType), but it says nothing extra about the three non-code parameters.

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 opening sentence gives a specific verb (Execute) plus resource (JavaScript code) and the exact scope of side effects (read, create, update, delete resources via the Cloudflare API). It is immediately distinguishable from the mcp-cloudflare-api siblings (search, docs, whoami), which are lookups rather than an execution surface.

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

Usage Guidelines4/5

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

It prescribes a concrete workflow: 'First use the "search" tool to find the right endpoints, then write code using the cloudflare.request() function.' That names a real sibling and the condition for calling it first. It does not say when to prefer docs or whoami instead, nor when not to use execute at all, so it falls short of a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources