Skip to main content
Glama

Score every candidate's relevance and return them sorted

jev_rerank

Rerank up to 250 candidates against a query, assigning each an independent relevance probability and returning them sorted by score. Use for retrieval ordering, dedup triage, or feed ranking.

Instructions

Rerank candidates against a query with TypeSafe Jev: one independent relevance probability per candidate, all in a single request, then sorted by score. Unlike jev_find (which picks one best answer), rerank scores every candidate so the full ordering survives. TypeSafe's rerank cookbook reports that on the CLERC benchmark this pattern lifted top-1 from 5% to 18% and top-10 from 38% to 62% (docs.typesafe.ai/cookbooks). Use for retrieval ordering, dedup triage, or feed ranking across up to 250 candidates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesWhat relevance is measured against, in natural language.
top_kNoHow many ranked candidates to return. Default: all.
candidatesYesCandidates to search. Up to 250 in one call; texts are truncated at 2000 chars.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that each candidate receives one independent relevance probability, that all are processed in a single request, and that results are sorted by score. It also mentions the 250-candidate limit. While it doesn't explicitly state the return format or confirm non-mutation, the description gives sufficient behavioral insight for an agent to understand what happens when the tool is invoked.

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 description is well-structured and front-loaded: it states the core action first, then differentiates from a sibling, provides a performance benchmark, and lists use cases. Each sentence adds value, though the benchmark detail, while useful, makes it slightly longer than strictly necessary. Still, it remains focused and efficient.

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

Completeness4/5

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

For a tool with no output schema and no annotations, the description is fairly complete. It covers the operation, the use cases, and the limits. The only notable omission is an explicit statement of the return structure (e.g., an array of candidates with scores), but that is largely implied by the description and the tool's purpose. Given the richness of the description, it is sufficient for an agent to call the tool correctly.

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

Parameters3/5

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

The schema has 100% coverage, so the description does not need to explain parameters. It does add a minor note about the 250-candidate cap, which matches the schema's maxItems, but it does not enrich the semantic understanding beyond what the schema already provides. Baseline 3 is appropriate.

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?

The description clearly states the tool's action: rerank candidates against a query, scoring each independently and sorting by score. It explicitly differentiates from jev_find by noting that find picks one best answer while rerank scores every candidate, so the full ordering survives. This is a specific verb + resource with clear scope.

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?

The description provides explicit when-to-use guidance, naming jev_find as an alternative and explaining the distinction. It also lists concrete use cases: retrieval ordering, dedup triage, and feed ranking. It even mentions a benchmark to suggest when this pattern is beneficial, giving the agent a clear decision heuristic.

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