Skip to main content
Glama

Text Embeddings and Rerank

text_embed
Read-only

Sentence embeddings (all-MiniLM-L6-v2, 384 dimensions, L2-normalized, multilingual input works best in English) for semantic search, clustering and deduplication, or rerank mode: pass query + documents to get documents sorted by cosine similarity. Runs locally, texts are not stored. Params: texts (1 to 32 strings, max 2000 chars each) for embed mode, or query + documents (up to 64) and top_k for rerank mode. Price: $0.002 USDC per call, paid inside this MCP call via x402 (USDC on Base, Solana, Polygon or Arbitrum). x402 MCP clients such as @x402/mcp pay automatically. Free sample: call with the example input {"query":"how do AI agents pay for APIs?","documents":["x402 lets agents pay per call with USDC","The cat sat on the mat","Weather in Berlin is sunny"]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
textsNo
top_kNo
documentsNo
include_embeddingsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses genuinely material traits: execution is local, texts are not stored, and each call costs $0.002 USDC via x402 with the specific chains supported and automatic payment by x402 clients. Payment requirements and data-retention behavior are exactly the kind of context annotations cannot express.

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?

Front-loaded with model, dimensions and modes, then parameters, then pricing — a sensible priority order. The free-sample example JSON is verbose but defensible for a tool with no required parameters, though it adds bulk that could be trimmed.

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 dual-mode, paid, zero-required-param tool with no output schema, the description covers modes, limits, pricing and privacy well. The remaining gaps are the return shape (how embeddings are returned, and what include_embeddings does) and what happens if both texts and query are supplied simultaneously.

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

Parameters4/5

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

With 0% schema description coverage, the description carries the load: it states texts is 1-32 strings (schema only gives maxItems) of max 2000 chars, and that rerank mode needs query + documents (up to 64) plus top_k. This mode-to-parameter mapping is not derivable from a schema with zero required fields. It omits include_embeddings entirely, leaving one parameter with no explanation of what it returns.

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 names the concrete model (all-MiniLM-L6-v2), the output shape (384 dimensions, L2-normalized), and both operating modes (embedding vs. rerank) with the specific outcome of each ('documents sorted by cosine similarity'). An agent can distinguish this from siblings like text_classify or answer_with_sources without opening any schema.

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 clearly routes between the two modes: use embed mode for semantic search, clustering and deduplication, or rerank mode to sort documents against a query. However, it never names an alternative sibling tool or states when this tool should be preferred over them, so guidance is clear but not comparative.

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