An agent that starts calling tools before it has a plan will pick the first plausible tool and improvise from there. Write the plan first: each step names what it does, which tool it uses, and what good output looks like. CrewAI’s planning option does exactly this, asking a planning model for a step-by-step plan and refining it before execution. Keep the plan short and concrete; a plan with vague steps is no better than no plan.
What you need
- A task with a clear deliverable, written in one sentence
- The tools the agent may use, listed by name
- A done condition that says when the task is finished
Step 1: Write the steps with their tools
Break the task into steps of one job each, and write the tool each step uses next to it. A step with no tool named is a step the agent will improvise.
Step 2: Add a done condition to every step
For each step, write what its output must contain for the next step to start. Without a done condition the agent cannot tell a finished step from a half-finished one.
Step 3: Read the plan before letting the agent run
Read the plan as a checklist: every step has a tool, a done condition, and a next step that needs its output. Fix vague steps now, because fixing them after the run costs another full run.
Worked example: synthetic supplier-research plan
The table below is a synthetic example. It shows the expected result of planning first; no agent was run.
| Step | Tool named? | Done condition? |
|---|---|---|
| Find three suppliers | Search | Yes |
| Fetch each price list | Fetch page | Yes |
| Compare prices in a table | None – write | Yes |
| All steps have a tool and a condition | Yes | Pass |
Expected result (UNTESTED). every step names its tool and its done condition, and the plan reads as a checklist before the run starts. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A plan only helps if the steps are concrete; vague steps are improvised anyway.
- Planning adds model calls before the work, so skip it for one-step tasks.
- A plan written for one tool set breaks when a tool changes, so re-check it after any tool change.
- The agent may still depart from the plan mid-run, so check the run log against the plan afterwards.
