Module 1 · Foundations of Agentic AI · scripted

Tools: Constraining the Actions

20 minoutcomes: tool-design

From producing text to taking action

Remember the shape of an agent: it chooses an action, the action touches the world, and a report of what happened comes back into the conversation to drive the next choice.

The agent loop

In everything we've done so far, the actions have really just been producing text — instructions for a human to carry out. But most of the time, we want agents to take real actions that affect the real world: reach into a calendar and pull the available meeting times, send an email, start a machine. And the sveler agent showed the problem with letting the LLM dream its actions up: it assumed a fully equipped kitchen and planned with tools nobody said existed.

So we do something better: we tell the LLM, up front, exactly what tools it has — and the tools bound the space of actions it can take.

Tools bound the action space

The prompt: tools, task, rules

Here is the prompt shape we'll use for the rest of this lesson — the tools declared as a list, the task, and rules that force one clearly formatted step at a time:

The shape of the prompt

user prompt
You have the following tools available for use: ----------- - tool - tool Task: what to accomplish Rules: 1. You must select one step at a time. 2. You must output a step in the format Step N: Use Tool - Notes 3. You wait for a description of what happened to be provided back to you. 4. You choose the next step. 5. When done, you output just END.

Example 1 · Two tools

Example 1 · Coarse tools
user

You have the following tools available for use:


  • microwave
  • plate

Task: Reheat a frozen dinner that needs 90 seconds on high.

Rules:

  1. You must select one step at a time.
  2. You must output a step in the format Step <N>: Use <Tool> - <Notes>
  3. You wait for a description of what happened to be provided back to you.
  4. You choose the next step.
  5. When done, you output just END.
assistant

Step 1: Use plate - Take the frozen dinner out of its box and place it on the plate.

user

Done. The dinner is on the plate.

assistant

Step 2: Use microwave - Heat the dinner on high for 90 seconds.

user

The microwave ran for 90 seconds and beeped. The dinner is hot.

assistant

END

NoteOne step, one tool, one short note — then wait for the world's report. The rules in the prompt made the agent's actions this easy to read.

Same task, finer tools

Now keep the task and the rules identical — and only change the tool list. These tools are smaller: each one does one tiny thing.

Example 2 · Fine-grained tools
user

You have the following tools available for use:


  1. set_microwave_power( power )
  2. set_microwave_cook_time( time in seconds )
  3. open_microwave_door()
  4. close_microwave_door()
  5. put_item_in_microwave( item )
  6. remove_item_from_microwave( item )

Task: Reheat a frozen dinner that needs 90 seconds on high.

Rules: the same five rules as before.

assistant

Step 1: Use open_microwave_door() - So the dinner can go in.

user

The door is open.

assistant

Step 2: Use put_item_in_microwave( dinner ) - Set it in the center.

user

The dinner is inside.

assistant

Step 3: Use close_microwave_door() - Sealed before heating.

user

The door is closed.

assistant

Step 4: Use set_microwave_power( high ) - The dinner needs full power.

user

Power is set to high.

assistant

Step 5: Use set_microwave_cook_time( 90 ) - Ninety seconds, per the package.

user

The microwave ran for 90 seconds and beeped.

assistant

Step 6: Use open_microwave_door() - To get the dinner out.

user

The door is open. Steam is coming out.

assistant

Step 7: Use remove_item_from_microwave( dinner ) - Careful, it's hot.

user

The dinner is out.

assistant

END

NoteSame task, same rules, same microwave — but seven steps instead of two. The granularity of the tools decided the shape of the solution: small words make long sentences.

Granularity is a dial

Tools can also fold several actions into one word. One more tool set, same task:

Example 3 · One tool that does more
user

You have the following tools available for use:


  1. reheat_in_microwave( item, time )
  2. put_item_in_microwave( item )
  3. remove_item_from_microwave( item )

Task: Reheat a frozen dinner that needs 90 seconds on high.

Rules: the same five rules.

assistant

Step 1: Use put_item_in_microwave( dinner ) - In the center.

user

The dinner is inside.

assistant

Step 2: Use reheat_in_microwave( dinner, 90 ) - One call covers power, timing, and running.

user

The microwave ran for 90 seconds and beeped.

assistant

Step 3: Use remove_item_from_microwave( dinner ) - Done heating.

user

The dinner is out.

assistant

END

Notereheat_in_microwave folded door, power, time, and start into a single word — and the solution shrank to match. Granularity is a design dial: you choose how much each word of the language means.

Different tools, different solution

Finally, take the microwave away entirely. Same frozen dinner — but now the tools describe a completely different corner of the kitchen:

Example 4 · No microwave at all
user

You have the following tools available for use:


  1. heat_water_in_tea_kettle()
  2. pour_water_from_tea_kettle( where to pour )
  3. put_item_in_bowl( item )
  4. remove_item_from_bowl( item )

Task: Reheat a frozen dinner that needs 90 seconds on high. The dinner is in a sealed, waterproof pouch.

Rules: the same five rules.

assistant

Step 1: Use heat_water_in_tea_kettle() - We'll use boiling water instead of a microwave.

user

The kettle has boiled.

assistant

Step 2: Use put_item_in_bowl( sealed dinner pouch ) - Keep it sealed; the bowl becomes our hot-water bath.

user

The pouch is in the bowl.

assistant

Step 3: Use pour_water_from_tea_kettle( into the bowl, over the pouch ) - Cover it completely, then let it sit about five minutes. Tell me when time is up.

user

Five minutes have passed. The water is still warm.

assistant

Step 4: Use remove_item_from_bowl( dinner pouch ) - It should be heated through.

user

The pouch is out and hot to the touch.

assistant

END

NoteNo microwave anywhere — and the agent never asked for one. The same goal produced a hot-water bath, because the plan is made of the tools. Change the tool list and you change the agent.
Read the four solutions
  • The task never changed. List what DID change across the four runs — and trace each change back to the tool list.
  • In Example 2, which steps exist only because the tools are small? In Example 3, what decisions disappeared inside reheat_in_microwave — and who makes them now?
  • What's the difference between "the LLM can't do X" and "X isn't in the tool list"?

Constraints as a design instrument

Declaring tools turns out to be one of the most important design moves in all of agent building. The tool list is how we tell the agent what kind of world it is acting in — and, just as important, what it must work around. A bowl becoming a hot-water bath and a seven-step microwave dance come from the same mechanism: the conversation states what actions exist, at what granularity, and the LLM composes a trajectory out of exactly those actions.

But so far, our tools are mostly just names. A real microwave doesn't accept "high" without being told what the choices are — it wants a power level and a time, with units and limits. That's the next lesson: tools have controls.

Your turn

Pick a task from your own domain and write two tool lists for it: one coarse (two or three big tools) and one fine (six or more tiny ones). Give an LLM the same task and the same five rules with each list. Where did the fine list force decisions the coarse list hid? Where did it just force busywork?