Skip to main content
Glama

Rank documents by relevance

rerank
Read-onlyIdempotent

Orders up to 100 documents by relevance to a query through POST /v1/rerank with a rerank model id from list_models (type rerank): each result's index into documents, its score and its text, best first. Billed per input token to the key in the MCP request's Authorization header.

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": {
      "model": "<model>",
      "query": "<query>",
      "documents": "<documents>"
    },
    "name": "rerank"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesA rerank model id from list_models (type rerank).
queryYesWhat the documents are ranked against.
top_nNoHow many to return, best first. Default: all.
documentsYesUp to 100 texts to rank.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, and non-destructive, and the description goes beyond them with cost and auth context: per-input-token billing charged to the key in the request's Authorization header, plus the concrete response shape (index into documents, score, text, best first). It does not mention failure modes, rate limits, or max payload beyond the 100-document cap, so it stops short of fully comprehensive.

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?

A single dense sentence that front-loads the action, endpoint, and result ordering, then ends with billing — no filler. It is packed tightly enough that splitting the cost/auth clause out would slightly aid scanning.

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 no output schema, the description must describe the return value, and it does: per-document index, score, and text, ordered best first. Combined with the model prerequisite, the size caps, and billing/auth transparency, an agent has enough to call this correctly in one shot.

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 coverage is 100%, so every parameter is already documented, including model provenance, the 100-item and 4000-char caps, and top_n's "best first" ordering. The description mostly restates these limits rather than adding new meaning, which is the expected baseline 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") plus the exact transport (POST /v1/rerank) and the model source (list_models, type rerank). An agent can distinguish this from embed, search, or compare without opening the schema.

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 implied by the stated semantics — use it to rank a bounded set of texts against a query — and the model prerequisite is spelled out ("a rerank model id from list_models (type rerank)"). However, it never says when to prefer this over siblings like search or embed, nor any exclusions, so routing still requires inference.

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.