Skip to main content
Glama

Semantic similarity ranking

similarity
Read-only

Ranks up to 15 candidate texts by cosine similarity to a query, using @cf/baai/bge-base-en-v1.5 embeddings. Returns { model, ranked: [{ index, score }] (highest first), scores: number[] (input order) } Price: 3 credits (1 credit = 1 CAD cent) per successful call; input that does not match the schema is rejected before billing.

Input Schema

NameRequiredDescriptionDefault
queryYesQuery text, up to 2000 characters.
candidatesYes1 to 15 candidate texts, each up to 2000 characters.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description adds real behavioral context: the specific embedding model, the exact return shape and ordering, the 3-credit price per successful call, and the fact that schema-invalid input is rejected before billing. That billing-before-validation note is genuinely useful and not derivable from annotations.

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?

Dense but front-loaded: the operation lead, then return shape, then pricing. Every clause carries information; the pricing sentence is long but includes a unit clarification that prevents a costly misread.

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?

There is no output schema, and the description compensates fully by spelling out the returned object fields, their ordering, and the scores array's input-order alignment. Combined with the cost model, an agent has everything needed to call and interpret the result.

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 are already documented with their min/max lengths and item limits. The description echoes the 15-candidate cap but adds no format or semantic detail beyond the schema, making the baseline 3 appropriate.

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

Purpose4/5

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

States a specific verb and resource ('Ranks ... candidate texts by cosine similarity to a query') and names the underlying model, so the operation is unambiguous. It does not, however, distinguish itself from close siblings like find-similar or embed, which an agent must choose between.

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

Usage Guidelines3/5

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

Usage is only implied by the operation itself (rerank a small candidate set against a query). There is no explicit statement of when to prefer this over find-similar or embed, nor any exclusions, so the agent must infer the routing decision.

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