Skip to main content
Glama

Embeddings, Rerank & Speech-to-Text (Tanod)

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. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare it as a safe, idempotent read; the description goes far beyond them with the model identity and license, the scoring formula (sigmoid of the logit in 0-1), 512-token truncation with longest-side-first disclosure, the 32,768-token 422 and 503 failure modes, latency range, price, free-tier limit and a no-logging guarantee. That is unusually complete behavioral context for an inference tool, all of it in addition to the safety hints.

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?

The core action, the sibling routing and the return shape are front-loaded, and pricing/failure modes follow in a logical order. It is a dense run-on paragraph with many semicolon clauses, so scanning takes effort, but essentially every clause carries decision-relevant information.

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?

Despite an output schema already covering the return fields, the description still summarizes them, and it covers cost, quotas, failure codes and privacy for an inference endpoint where those are the main agent concerns. Nothing needed to call it correctly or predict its outcome is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: `top_k` keeps the best k, documents are cut at the model's 512-token window (interacting with the 4,000-character per-document cap), and the request-wide token budget explains the 422. Only the exact character-to-token relationship is left implicit.

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?

"Rerank up to 100 documents against a query" is a specific verb plus resource with an explicit scope bound, and the following sentence routes the agent away from the sibling text_similarity for pairwise work. An agent can tell exactly what this does and what it does not do 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names the alternative tool (text_similarity) and the condition that selects it (pair scores), which is the exact decision an agent faces between these two tools. No when-not guidance beyond that is needed given how narrow the tool's remit is.

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.