Rerank search results or candidate documents by relevance to a query using DashScope rerank models. Use when the user asks to rerank, reorder, or sort results/passages by relevance, or improve search-result ordering.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rerank?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/dashscope-rerank)
---
description: Rerank search results or candidate documents by relevance to a query using DashScope rerank models. Use when the user asks to rerank, reorder, or sort results/passages by relevance, or improve search-result ordering.
---
# Rerank (DashScope)
Use the `rerank_documents` MCP tool from the dashscope server to order
candidate documents by relevance to a query. This is more accurate than
embedding similarity for final search-result ordering.
## How
Call `rerank_documents` with:
- `query`: the user's query.
- `documents`: the candidate texts (e.g. initial search hits).
- `top_n` (optional): return only the top N.
- `return_documents` (optional): set true to include each document's text in
the result; otherwise results carry `index` + `relevance_score` only.
Results come back ordered by `relevance_score`, each with its original
`index`. Map indices back to the user's documents and present the new order.
## Typical pipeline
Retrieve candidates (keyword/vector search) → `rerank_documents` → show the
top results. For pure meaning-similarity without a rerank model, use the
semantic-search skill instead.
## Errors
Missing/rejected key → set `DASHSCOPE_API_KEY` in the server env (Claude Code:
`/plugin configure dashscope`). Throttling → retry.