Skip to main content
Glama

score_list

Rank a list of existing refs by scoring with an evaluator, returning the top-k winners. Avoids parameter size limits by resolving artifacts server-side.

Instructions

Score and rank a list of existing refs against an evaluator.

This is the missing piece for "generate N candidates, then pick the best" pipelines where the N candidates already exist as refs from an upstream combinator (map, par, etc.) — beam is the wrong shape because it fans out width-N proposers of the same prompt, whereas score_list takes N different outputs and ranks them.

The key infrastructure point: refs are resolved to their artifact text server-side, so callers do not need to pipe full artifact text through tool parameters. This clears the ~4KB param-size wall you would otherwise hit scoring 6+ medium-length artifacts through map.

Evaluator forms are the same as iterate / beam:

  • validate:<type> — LLM validator against a registered type

  • score:<criterion> — ad-hoc haiku rubric

  • exec:<shell-cmd> — ground-truth shell command (exit code scoring)

Each ref is tagged with a search stamp carrying its score and beam_rank. Refs outside the top-k are marked pruned=True with a reason pointing at the beam cut. top_k=0 means return all without pruning.

Args: refs: JSON array of refs — either ["run_id/agent_id", ...] or [{"ref": "run_id/agent_id"}, ...]. Both forms are accepted. evaluator: Scoring directive (validate:<type>, score:<criterion>, or exec:<cmd>). top_k: How many top-scoring refs to surface as winners. 0 means rank-only, no pruning stamp applied. max_concurrency: Upper bound on parallel evaluator calls (default: 5).

Returns: JSON with run_id, evaluator, total, top_k, winners (list of winning ref strings), and ranked (the full per-ref trace: rank, ref, score, verdict, issues, reason).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refsYes
evaluatorYes
top_kNo
max_concurrencyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses that refs are resolved server-side, each ref gets a 'search' stamp with score and 'beam_rank', and out-of-top-k refs are marked 'pruned=True'. It also describes the return structure including run_id, winners, and ranked trace. All behavioral traits are clearly explained.

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?

The description is well-structured and front-loaded: a one-sentence purpose, then context and infrastructure points, evaluator forms, args, and returns. Every sentence adds value, and there is no wasted text. It is appropriately sized for the tool's complexity.

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

Completeness5/5

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

Given that an output schema exists, the description does not need to elaborate on return values, but it still summarizes the return JSON. It covers purpose, usage contrast, behavioral details, parameter semantics, and returns. For a tool with this complexity and many siblings, it is complete and leaves no gaps.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It explains each parameter in detail: 'refs' can be an array of strings or objects, 'evaluator' supports three forms, 'top_k' controls pruning (0 means rank-only), and 'max_concurrency' has a default of 5. This adds significant meaning beyond the schema.

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 scores and ranks a list of existing refs against an evaluator. It distinguishes itself from sibling 'beam' by explaining that 'beam' fans out proposers for the same prompt, while 'score_list' handles different outputs. This provides specific verb+resource and differentiation.

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 explicitly tells when to use this tool: for pipelines where N candidates already exist as refs, and contrasts it with 'beam' as the wrong shape. It explains evaluator forms, top_k behavior, and server-side ref resolution to overcome parameter size limits. This provides clear context and alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stiege/swarm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server