Skip to main content
Glama
puspoaditya

Cloudflare Workers AI MCP Server

chat_completion

Send a chat message list to Cloudflare Workers AI and get a complete assistant reply for summarization, translation, Q&A, classification, or code generation.

Instructions

Run an LLM chat completion using Cloudflare Workers AI. Use this tool when you need direct LLM inference with an explicit message list (system/user/assistant roles) — for example summarization, translation, Q&A, classification, or code generation. The request is sent to the Workers AI OpenAI-compatible endpoint and the full assistant reply is returned as a single text block together with the model id and finish reason. No streaming is performed. Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables; costs are billed to your Cloudflare account (free tier available).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesWorkers AI chat model id. Available models: @cf/meta/llama-3.3-70b-instruct-fp8-fast (default, strong generalist), @cf/meta/infire-llama-3.1-8b-instruct (small and cheap), @cf/meta/llama-4-scout-17b-16e-instruct, @cf/qwen/qwen2.5-coder-32b-instruct (coding), @cf/deepseek-ai/deepseek-r1-distill-qwen-32b (reasoning). Call list_models for the full catalog.
messagesYesChat messages in chronological order. Use role system for instructions, user for the human input, assistant for prior model replies when continuing a conversation.
max_tokensNoMaximum number of tokens to generate. Default 512. Lower values return faster and cheaper; higher values allow longer replies.
temperatureNoSampling temperature between 0 and 2. Default 0.7. Lower values produce more deterministic output; higher values increase creativity and variety.
Behavior5/5

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

With no annotations present, the description carries full responsibility and delivers: endpoint destination, exact return shape (assistant reply as a text block with model id and finish reason), non-streaming behavior, required environment variables, and cost/billing context. This far exceeds typical descriptions.

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?

Three sentences, each earning its place: purpose+usage, behavior/return, and operational requirements. Information is front-loaded and free of redundancy.

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

Completeness5/5

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

Given moderate complexity, no annotations, and no output schema, the description still explains return values, authentication, billing, and the endpoint. It fully equips an agent to invoke the tool correctly and interpret the response.

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% with detailed parameter descriptions for model, messages, max_tokens, and temperature. The tool description adds contextual framing but no new parameter-level semantics, so the baseline of 3 is appropriate.

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 opens with 'Run an LLM chat completion using Cloudflare Workers AI' — a clear verb+resource statement. It distinguishes the tool from siblings (list_models, embed_text, generate_image) by specifying the message-list interaction and concrete use cases like summarization, translation, Q&A, and code generation.

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

Usage Guidelines5/5

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

Explicitly states 'Use this tool when you need direct LLM inference with an explicit message list' and lists example tasks. It also clarifies what this tool does not do ('No streaming is performed'), helping the agent choose appropriately among sibling inference tools.

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/puspoaditya/cloudflare-workers-ai-mcp'

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