Skip to content
Back to skills

Rerank

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsapi

Works with

  • claude code
  • api
  • mcp

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add dashscope/dashscope-agent-tools-python --skill rerank --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rerank?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rerank
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dashscope-rerank/badge)](https://www.skillsdirectory.com/skills/dashscope-rerank)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.