> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# builtin__infer

> Runs one model call over an instruction and returns text or structured JSON.

## Behavior

* Returns `{text}` by default.
* With `output_schema`, returns JSON validated against it, so every declared field is present.
* `model` picks a model role; omit it for the chat role.

## When to use it

* Classify, extract or summarize inside a plan.
* Inside a `map`, interpolate `{{item}}` per call instead of passing the whole list.

| Loaded | Kind | Effect |
| - | - | - |
| Always | `prompt` | Not marked read-only |

## Input

**instruction** `string` *required*

Complete, self-contained instruction, including the data to analyze (reference earlier step results with \{\{Ex...}} templates, or the current element with \{\{item}} inside a map body).

**system** `string`

Optional standing instructions sent as the system prompt instead of in the instruction. Keep it identical across calls that share it — across the items of a map, say — so the provider can cache it.

**output\_schema** `object`

Optional JSON Schema for the result. When present, the output is structured JSON matching this schema instead of \{text: ...}. Must be an object schema: give it a top-level "type": "object" and a "properties" map (a bare \{properties, required} is coerced to object, but write the type explicitly).

**on\_mismatch** `enum\<string\>`

What to do when the output still doesn't match output\_schema after the automatic fix-up: "error" (the default) fails the step; "return" hands back the output as it is, for a caller that checks it itself and retries.

Available options: `error`, `return`

```yaml Plan step theme={null}
- id: E1
  tool_name: builtin__infer
  input:
    instruction: "{{input.instruction}}"
```

```bash Inspect theme={null}
graph tool show builtin__infer
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.