Skip to main content
Glama
puspoaditya

Cloudflare Workers AI MCP Server

embed_text

Generate numerical vector embeddings for text inputs, enabling semantic search, clustering, deduplication, or retrieval-augmented generation. Returns one embedding array per text in input order.

Instructions

Generate numerical vector embeddings for one or more text inputs using Cloudflare Workers AI. Use this tool when you need semantic vector representations of text — for example similarity search, clustering, deduplication, or retrieval-augmented generation. Returns one embedding array (384-dimensional for BGE small, 768 for BGE base) per input text, in the same order as the inputs. Embeddings are generated by the native Workers AI endpoint and are deterministic for identical inputs. Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesEmbedding model id. Available: @cf/baai/bge-small-en-v1.5 (384 dimensions, faster), @cf/baai/bge-base-en-v1.5 (768 dimensions, higher quality).
textsYesOne or more texts to embed (up to 10 per call). Each text becomes one embedding vector returned in the same order.
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: deterministic output for identical inputs, output ordering matching input order, dimensionality varying by model, environment variable requirements, and native endpoint usage. This goes well beyond a minimal 'embed' description.

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 focused sentences with zero filler. The first sentence states the core action, the second gives usage context and return format, and the third covers prerequisites and determinism. Each sentence earns its place and the most essential action is front-loaded.

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?

For a simple two-parameter tool with no output schema, the description fully covers what an agent needs: return value shape, array ordering, model dimensionality differences, determinism, and required environment variables. It is complete for its complexity and unlikely to cause confusion among siblings.

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 100%, so both parameters (model, texts) are fully documented in the schema. The description adds some model-dimension detail, but that is already present in the schema's model property description. It re-states 'same order' which is also in the texts property description. No significant new semantic information is added beyond the schema.

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 a specific verb+resource: 'Generate numerical vector embeddings for one or more text inputs using Cloudflare Workers AI.' It clearly distinguishes this from siblings like chat_completion and generate_image by stating the exact purpose (semantic vector representations) and mechanism (Workers AI endpoint).

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?

Provides explicit when-to-use guidance: 'Use this tool when you need semantic vector representations of text — for example similarity search, clustering, deduplication, or retrieval-augmented generation.' It does not explicitly state when-not-to-use or name alternatives, but the use-case list is clear and sufficient for an embedding tool.

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