Skip to main content
Glama

rerank_documents

Rerank candidate documents by relevance to a query to improve search-result ordering, returning each match's original index and relevance score.

Instructions

Rerank candidate documents by relevance to a query (DashScope rerank).

More accurate than embedding similarity for search-result ordering. Returns each match's original index and relevance_score.

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
modelNogte-rerank-v2
queryYes
top_nNo
documentsYes
return_documentsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does state the return shape (original index plus relevance_score), which is useful behavioral context, but it says nothing about limits on document count, token/length constraints, cost, or whether results are a re-ordering of the input versus a filtered subset.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short lines, front-loaded with the action and followed by the differentiator and the return format. No filler or repeated information, and every sentence adds something.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a full output schema present, the description need not explain return values in depth, and it briefly does anyway. However, for a five-parameter tool with zero schema coverage and no annotations, the missing guidance on top_n and return_documents leaves the definition only minimally complete.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description must compensate and largely does not. It hints at 'query' and 'documents' by restating the tool's purpose, but top_n, return_documents, and model (including its default) get no explanation whatsoever, leaving real ambiguity about how to shape the call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Rerank candidate documents by relevance to a query') and adds the provider context (DashScope rerank). It also distinguishes the operation conceptually by saying it is 'more accurate than embedding similarity for search-result ordering,' which helps separate it from embed_text/semantic_search without naming them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

It gives a clear usage context, search-result ordering, and contrasts the tool with embedding-similarity approaches, which implies when to reach for it. It stops short of explicit when-not conditions or naming a concrete alternative tool, so it sits just below the top band.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.