Skip to main content
Glama

rerank_documents

Read-onlyIdempotent

mlpeek: Rerank up to 100 documents against a query. For pair scores use text_similarity. Returns 1-100 documents scored against a query by the ms-marco-MiniLM-L6-v2 cross-encoder (Apache-2.0) and sorted best first: index, rank, score (sigmoid of the logit, a relevance in 0-1) and logit; top_k keeps the best k. English model. Each text is cut at the model's 512-token window and the answer says so (longest side first). Over 32,768 tokens per request is a 422 too_many_tokens (not charged). Runs an open model pinned by hash on Tanod's own CPU (no LLM, no third-party API); an unavailable model is a 503 (not charged). Typically 0.1-2 s, up to about 10 s at the token budget. Price: USD 0.002. Free: 5 mlpeek calls per IP per UTC day. The submitted text is never logged or stored. Docs: https://tanod.dev/learn/embeddings-rerank-ner-mcp-server.html

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_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe query (at most 2,000 characters).
top_kNoKeep the best k (default: all, ranked).
documentsYes1-100 documents, each at most 4,000 characters.

Output Schema

NameRequiredDescriptionDefault
noteNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
modelNo
usageNo
resultsNo
max_tokens_per_pairNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / properties / documents / title
      Removed value: -"Documents"
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / properties / top_k / default
      Removed value: -null
    • removedInput schema / properties / top_k / title
      Removed value: -"Top K"
    • removedInput schema / title
      Removed value: -"rerank_documentsArguments"
    • removedOutput schema / properties / model / properties
      Removed value: -{
      -  "alias": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "id": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "license": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "revision": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "source": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / results / items
      Removed value: -{
      -  "properties": {
      -    "index": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "logit": {
      -      "type": [
      -        "number",
      -        "null"
      -      ]
      -    },
      -    "rank": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "score": {
      -      "type": [
      -        "number",
      -        "null"
      -      ]
      -    },
      -    "tokens": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "truncated": {
      -      "type": [
      -        "boolean",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "max_tokens_per_pair": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "model": {
      +      "properties": {
      +        "alias": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "id": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "license": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "revision": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "source": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "results": {
      +      "items": {
      +        "properties": {
      +          "index": {
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "logit": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "rank": {
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "score": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "tokens": {
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "truncated": {
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "usage": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources