Rank documents by relevance
rerankOrders 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
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | A rerank model id from list_models (type rerank). | |
| query | Yes | What the documents are ranked against. | |
| top_n | No | How many to return, best first. Default: all. | |
| documents | Yes | Up to 100 texts to rank. |