> ## 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.

# compose_plan

> Drafts a whole plan for a goal from the tools in your catalog.

## How it works

1. Lists the plan's inputs and the capabilities it needs.
2. Searches the catalog for a tool for each capability. If none fits, it stops and returns what's `missing`.
3. Writes the whole plan in one call.
4. Asks you about values it had to guess.
5. Validates the plan and fixes failing steps, up to three rounds.

`graph plan draft`, the workbench and MCP's `graph_plan_draft` all run this plan.

## Input

**goal** `string` *required*

What the plan should accomplish

**needs\_model** `string` (default: outliner)

The model role that lists the plan's inputs and capabilities

**model** `string` (default: planner)

The model role that writes and fixes the plan

## Output

**needs** `object`

What the goal requires, as `inputs`, `capabilities` and `details`, worked out before drafting.

**plan** `object`

The drafted plan. Null when no tool could do part of the goal.

**valid** `boolean`

Whether the drafted plan passed validation.

**problems** `string[]`

Validation problems left after fixing. Empty when the plan is valid.

**yaml** `string`

The drafted plan as a YAML file.

**questions** `object[]`

Values the draft had to guess, as questions for you, each with the guess it used.

**missing** `object[]`

Capabilities no tool in the catalog could cover. Empty when a plan was drafted.

## Steps

| Step | Calls |
| - | - |
| `needs` | `builtin__infer` |
| `data` | `filter` |
| `found` | `map` |
| `gaps` | `filter` |
| `stop` | `exit` |
| `context` | `builtin__compose_context` |
| `prompt` | `builtin__reshape` |
| `draft` | `builtin__infer` |
| `form` | `builtin__question_form` |
| `clarify` | `route` |
| `checked` | `builtin__check_plan` |
| `start` | `builtin__reshape` |
| `fixed` | `reduce` |

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

```bash Customize theme={null}
graph plan show compose_plan > .graph/plans/compose_plan.yaml
```


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