Skip to main content
Glama

Answer a choice question over many labels (coarse-to-fine)

decide_shortlist
Read-onlyIdempotent

Pick one from many labels without degrading the prompt budget by shortlisting top k options before deciding.

Instructions

Pick one of many labels without degrading the prompt budget.

Laya scores every option inside a fixed token budget, so a 200-label choice loses resolution. This embeds the state and each label, keeps the top k, then runs the normal decision pass on those. Use it above ~40 labels, or whenever labels are long. k above the label count is a no-op and reports shortlisted: false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoLabels kept from the shortlist stage
stateYesContext used both to shortlist and to decide
choicesYesChoice labels as {label: when-to-pick}; may be hundreds of labels
thresholdNoAs in `decide`
use_cacheNoReuse an identical answer
instructionsYesWhat the choice means

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
gradeYesOverall grade; act autonomously only when this is auto_execute
usageNo
cachedNoTrue when served from the in-process cache
answersYes
routingYes
summaryYes
contractYesDirective: overall grade, per-question grades, and the reasons for them
autonomousYesTrue when every answer cleared the auto-execute bar
latency_msYesServer-side inference time
requires_humanYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and closed-world behavior, so the safety profile is covered. The description adds real value beyond that: the two-stage embedding/shortlist mechanics, the fixed token budget rationale, and the shortlisted:false no-op outcome for oversized k.

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?

Front-loaded with the core purpose, then the mechanism, then the usage threshold and edge case, with little waste. The line breaks and title repeat add minor friction but no meaningful bloat.

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?

With an output schema present (return values need not be explained) and annotations covering the safety profile, the description supplies the remaining essentials: mechanism, when-to-use threshold, and the no-op edge case. Naming the decide sibling directly would close the last gap.

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 coverage is 100%, so the baseline is 3 and the schema already documents parameters. The description adds meaning for k (top-k kept from the shortlist stage, no-op above the label count) and ties threshold back to the decide tool, going beyond the schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource (pick one label from many) and frames the tool's distinctive mechanism (shortlist-then-decide) versus a plain decision pass. Sibling differentiation is implicit rather than explicit: it gestures at the 'normal decision pass' (i.e. decide) and a label-count threshold, but never names the alternative tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete activation condition ('above ~40 labels, or whenever labels are long') plus an edge-case rule (k above the label count is a no-op returning shortlisted: false). It does not explicitly say which sibling to use below the threshold, so the routing is inferable but not spelled out.

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