Skip to main content
Glama

Orders up to 50 documents by relevance to a query

rerank
Read-only

Orders up to 50 documents by relevance to a query with the BGE reranker and returns rank, index and score for each. Use it after a keyword or vector search to pick the best few. Scores compare documents within one call only. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>",
      "documents": "<documents>"
    },
    "name": "rerank"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe question or search, up to 500 characters
documentsYes1 to 50 documents, up to 2,000 characters each

Output Schema

NameRequiredDescriptionDefault
countNo
modelNo
queryNo
resultsNo
checkedAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description goes well beyond them by disclosing the pricing model ($0.002 per successful call), the payment mechanism (x402, USDC on Base/Solana/other networks), the fact that failed calls are not charged, and the critical scoring caveat that scores are comparable only within a single call. The billing/auth detail is exactly the kind of operational context an agent needs before invoking a paid endpoint.

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?

Three sentences, front-loaded with the core purpose before the usage hint and the commercial terms. Every sentence carries information, though the network enumeration ('Base, Solana and 10 more networks') is detail that could be compressed or deferred to documentation.

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?

A rich output schema exists, so the description is not obligated to explain return values, and it covers the important extras anyway: cost, payment path, failure billing, and score comparability scope. It does not address edge behavior such as what happens at the 50-document boundary, but that is minor for a two-parameter, fully documented tool.

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%, and the schema itself already carries the 500-character query limit and the 1–50 documents / 2,000-character caps. The description's 'up to 50 documents' merely restates that, adding no format or syntactic detail beyond the schema. Baseline 3 is correct when the schema does the heavy lifting.

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 and resource ('orders documents by relevance to a query'), names the underlying model (BGE reranker), and discloses the exact return fields (rank, index, score). The agent knows precisely what the tool produces without opening the output 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?

Gives an explicit workflow position: 'Use it after a keyword or vector search to pick the best few.' That tells the agent the correct upstream step and the intent (narrowing a candidate set). It stops short of naming a concrete alternative or stating when not to use it, so it falls below a 5.

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