Skip to main content
Glama

Score every candidate's relevance and return them sorted

jev_rerank

Score up to 250 candidates against a query with one relevance probability each, returning the full ranked order for retrieval ordering 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. Changed1 schema field changedv0.10.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavior: one independent relevance probability per candidate, a single request, sorted output, a 250-candidate limit, and 2000-character truncation. It does not explicitly state read-only safety, auth needs, or error behavior, but the core computational semantics are clear.

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

Conciseness3/5

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

Front-loads purpose and the sibling differentiator, then use cases. However, the benchmark statistics sentence ('lifted top-1 from 5% to 18%...') is promotional and does not help an agent invoke the tool, so not every sentence earns its place.

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?

No output schema exists, so the description should explain return values; it states sorted relevance probabilities but not the exact output shape (e.g., id and score fields). For a 3-parameter tool with a rich input schema and no annotations, it covers purpose, behavior, and limits well enough to select and call.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by noting that candidate texts are truncated at 2000 characters (not enforced in the schema) and reinforces the 250-candidate cap. It does not add new meaning for query or top_k.

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?

States a specific verb (Rerank), resource (candidates against a query), and result (sorted relevance probabilities). Explicitly distinguishes itself from sibling jev_find ('picks one best answer'), so an agent can tell them apart without opening either 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?

Gives concrete use cases (retrieval ordering, dedup triage, feed ranking) and names the alternative jev_find with the condition that selects it. Implicitly covers when not to use it: when only one best answer is needed.

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