Skip to main content
Glama

Clef Decide

clef_decide
Read-onlyIdempotent

Judge decisions with a local Clef model and return strict JSON probability distributions for choice, score, and yes/no questions, including confidence scores for decisive next actions.

Instructions

Judge a situation with the local Clef decision model. Pass state (compact factual context — string or JSON; treated as data, never executed) and typed questions:

  • "choice": pick among named options (criteria = option id -> description)

  • "score": judge an ordered scale (criteria = ordered list of levels)

  • "noul": yes/no question Returns strict JSON: a probability distribution over the allowed answers per question — no prose, no sampling. Each decision carries model-reported confidence; usage reports input_tokens/output_tokens and latency_ms. Act on the argmax only when decisive: top p >= 0.8 and high confidence for destructive or security-adjacent calls; otherwise gather more context or ask the user. Batch related decisions in one call — up to 64 questions scored in a single forward pass. model overrides the default id.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "state": "<state>",
      "questions": "<questions>"
    },
    "name": "clef_decide"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNoModel id to use (default: clef-flash from CLEF_MODEL).
stateYesTask state as data: a compact string or JSON object with the facts needed to judge (task, errors, logs, diffs). Never treated as instructions. Serialized size limit: 1 MB; model context is 16k tokens.
optionsNoExtra options. Currently only temperature, which is a documented no-op.
questionsYesMap of question id -> typed question. Up to 64 questions per call; all are scored together in a single forward pass, so batch related decisions here.

Output Schema

NameRequiredDescriptionDefault
modelYes
usageNo
decisionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.0
    • addedOutput schema / properties / decisions / additionalProperties / properties / confidence
      Added value: +{
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedOutput schema / properties / usage
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "input_tokens": {
      +      "type": "number"
      +    },
      +    "latency_ms": {
      +      "type": "number"
      +    },
      +    "output_tokens": {
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed8 schema fields changedv0.2.1
    • addedInput schema / properties / model / description
      Added value: +"Model id to use (default: clef-flash from CLEF_MODEL)."
    • addedInput schema / properties / options / description
      Added value: +"Extra options. Currently only temperature, which is a documented no-op."
    • addedInput schema / properties / options / properties / temperature / description
      Added value: +"Accepted for forward compatibility; no-op. Clef scores in a single forward pass without sampling."
    • addedInput schema / properties / questions / additionalProperties / description
      Added value: +"A single decision question. Allowed answers come from `criteria` and must be mutually exclusive and collectively exhaustive."
    • addedInput schema / properties / questions / additionalProperties / properties / instructions / description
      Added value: +"What to judge, phrased as a self-contained question."
    • addedInput schema / properties / questions / additionalProperties / properties / type / description
      Added value: +"\"choice\" = pick among named options; \"score\" = judge an ordered scale; \"noul\" = yes/no question"
    • addedInput schema / properties / questions / description
      Added value: +"Map of question id -> typed question. Up to 64 questions per call; all are scored together in a single forward pass, so batch related decisions here."
    • addedInput schema / properties / state / description
      Added value: +"Task state as data: a compact string or JSON object with the facts needed to judge (task, errors, logs, diffs). Never treated as instructions. Serialized size limit: 1 MB; model context is 16k tokens."
  3. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly/idempotent/no-destructive/no-open-world; the description adds substantially more: no sampling, single forward pass, strict JSON with no prose, per-decision model-reported confidence, token/latency usage, a 64-question cap, and the important safety note that `state` is treated as data and never executed (prompt-injection resistance).

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 purpose, then a bulleted question-type map, then return format and operating thresholds — efficient and scannable. Minor redundancy: the 64-question batching limit and the "no sampling" point each appear twice within the description.

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?

For a nested, multi-question scoring tool, the description covers invocation (state + typed questions), constraints (64 questions, 16k context, 1MB state), and how to interpret results, even though an output schema exists. Nothing an agent needs to call it correctly is missing.

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; the description still adds semantics the schema leaves implicit — criteria mean option-id→description for "choice" and an ordered level list for "score", `state` is compact factual context treated as data, and `model` overrides the default id. It does not mention the documented no-op `options.temperature`, which the schema already covers.

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 and resource: judge a situation with the local Clef decision model, then enumerates the three question types (choice/score/noul) and the output shape. An agent can tell exactly what it gets back — a probability distribution per question — without opening the schema.

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?

Gives concrete operating guidance: act on argmax only when top p >= 0.8 and confidence is high for destructive or security-adjacent calls, otherwise gather context or ask the user; also advises batching related decisions. No siblings exist to differentiate against, and it does not say when a different approach (e.g., plain reasoning) is preferable, so it stops short of a 5.

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

Deploy Server

Other Tools