Skip to main content
Glama

Ranking por palabras clave (BM25)

bm25-rank
Read-onlyIdempotent

Ordena hasta 2.000 documentos para una consulta con BM25 (sin embeddings), con palabras sin tildes. Cuándo: un flujo de agente necesita un resultado exacto y repetible para un paso auxiliar (tokens, costos, reintentos, fragmentos, ranking, limpieza de JSON). No para: ordenar hasta 2.000 vectores por similitud coseno con un vector consulta y devolver los k mejores (vector-top-k). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Ranks up to 2,000 documents for a query with Okapi BM25 (k1, b tunable) using accent-insensitive Unicode word tokens, e.g. to pick passages for retrieval without embeddings. When: an agent loop needs an exact, repeatable result for a bookkeeping step (tokens, costs, retries, chunking, ranking, JSON clean-up). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
bNob (number; optional; default 0.75; min 0; max 1).
kNoTop k (integer; optional; default 5; min 1; max 2000).
k1Nok1 (number; optional; default 1.2; min 0; max 5).
queryYesQuery (string; required; at least 1 chars; up to 2000 chars).
documentsYesDocuments (array of string; required; at least 1 items; up to 2000 items).

Output Schema

NameRequiredDescriptionDefault
resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / documents / examples
      Added value: +[
      +  [
      +    "Lista de festivos en Colombia 2026",
      +    "Recetas de cocina",
      +    "Calendario de Colombia"
      +  ]
      +]
    • addedInput schema / properties / query / examples
      Added value: +[
      +  "festivos Colombia"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Ranks up to 2,000 documents for a query with Okapi BM25 (k1, b tunable) using accent-insensitive Unicode word tokens, e.g. to pick passages for retrieval without embeddings. When: an agent loop needs an exact, repeatable result for a bookkeeping step (tokens, costs, retries, chunking, ranking, JSON clean-up). Not for: ranking up to 2,000 candidate vectors by cosine similarity (vector-top-k). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint=false, idempotentHint and destructiveHint=false, so 'no side effects / deterministic' largely restates structured data. However the description adds genuinely new behavioral facts not in annotations or schema: 64 KB input cap, 1 s per-call latency budget, and 1 MB result ceiling.

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 and well ordered: purpose, when, when-not, side effects, determinism, limits. It loses a point for the duplicated Spanish/English halves that repeat the same facts and the dangling meta-note '[EN completo / full EN: inputSchema.description]', which is noise rather than guidance.

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?

With rich annotations, a full output schema and 100% schema coverage, the remaining burden is limits and boundaries — and those are all stated (input size, latency, result size, determinism, no network). Nothing an agent needs to invoke it correctly is missing.

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 baseline is 3. The description adds marginal meaning by noting k1 and b are tunable and that tokens are accent-insensitive, but it never explains what k1/b control or how k relates to the returned list beyond a passing mention of 'los k mejores' in the negative example.

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?

States a specific verb (rank), resource (documents for a query), and algorithm (Okapi BM25 with tunable k1/b), plus the accent-insensitive tokenization detail that distinguishes it from generic sorters. It explicitly names the sibling it is not (vector-top-k), so an agent can route without opening either schema.

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?

Gives an explicit 'Cuándo' block with concrete agent-loop scenarios (tokens, costs, retries, chunking, JSON clean-up) and an explicit 'No para' block naming vector-top-k as the alternative for cosine-similarity ranking. Both the positive and negative selection conditions are stated.

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