- Discover the schema — what fields does the ruleset need?
- Collect values — either from user input, context, or an upstream tool.
- Decide — send field values, receive a decision envelope.
not_eligible and the user asks why.
Uses the public FSM child-eligibility ruleset. No API key needed.
1. Discover the schema
- CLI
- Python SDK
- curl
- MCP
field_id → value. For enum fields, only values listed in enum_values are accepted. For int / bool, standard JSON.
notes — each field can carry a list of structured FieldNoteOut entries. By convention each note has metadata.type ∈ {"why", "legal_background"} and a source citation. Conversational agents (e.g. an information-gathering paralegal bot) typically surface the WHY:-prefixed note verbatim when a user replies “why?” to a question, and draw on the LEGAL BACKGROUND:-prefixed note for follow-up questions about evidence and edge cases. Older bundles may return "notes": [] — your code should treat the array as optional.
weight — higher = less preferred to ask. The decision engine uses this for optimal-path computation when there are multiple ways to satisfy a ruleset (e.g. ask the cheap nationality question before the expensive English-test one).
2. Collect field values
Agent-side logic — the API doesn’t care how you got the values. In practice: ask the user, read from a session object, or derive from upstream context. If a field is missing, the decision can still return (asundetermined) — just be ready to ask for it next.
3. Decide
- CLI
- Python SDK
- curl
- MCP
eligible— all criteria satisfiednot_eligible— one or more criteria failedundetermined— engine couldn’t decide (missing field, discretionary clause, or case outside the compiled rules)
undetermined, inspect missing_fields in the response. Add the missing values and call again. include_trace adds per-group outcomes so you can show the user why.
4. (Optional) Explain the decision
For anot_eligible where the user asks “why”:
- CLI
- Python SDK
- curl
- MCP
--explain flag calls /decide with trace, then /explain-failure when the outcome is not_eligible, and renders both in one pass.Composing multiple sections (rulebook)
If your domain has more than one section and you want one decision over the composition (e.g. FSM: child eligibility AND (household criteria OR universal infant)), use therulebook_id field instead of ruleset_id. Rulebook evaluation always requires an API key — see Nomenclature for why.
section_results array with each section’s individual outcome.
Next steps
- Debug a failing decide — when things don’t go as expected
- MCP tools reference — every tool + parameters
- Decision envelope — replay and audit contract