text_rerank
Rerank search results or RAG chunks by relevance to a query: JSON body {query, documents, top_k}. Up to 50 documents (strings or {id, text}), each up to 2,000 chars. Returns the documents sorted by a 0-1 relevance score from the bge-reranker-base cross-encoder. Texts are not stored. Price $0.005 USDC per call via x402. Example output: {"documents":3,"returned":2,"model":"baai/bge-reranker-base","results":[{"rank":1,"index":0,"score":0.9312,"text":"Photosynthesis turns light, water and carbon dioxide into sugar."},{"rank":2,"index":2,"score":0.4105,"text":"Chlorophyll absorbs sunlight in leaves."}]}
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": "text_rerank"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query, max 1,000 characters | |
| top_k | No | Optional number of results, default all | |
| documents | Yes | 1 to 50 strings or {id, text} objects, each max 2,000 characters | |
| return_documents | No | Optional, default true |