Concepts / Tool Use in Agentic Systems

Tool Use in Agentic Systems

A planning failure occurs when an agent's plan does not achieve the goal, violates a constraint such as budget or time, or rests on an error in the agent's reflection about its own completion.

  • Programming

A Fluent Plan Can Still Fail

When people first evaluate an AI agent, they often read its answer and ask whether it sounds good. An agent's plan can be detailed, confident, and well organized, and still fail the person who asked for it. Evaluating planning ability means checking three things: whether the plan actually accomplishes the task, whether it respects the limits the task sets, and whether it uses its tools correctly. This article builds that checklist one piece at a time, and it follows a plan through the agent's run to show where each kind of failure can enter.

Tracing a Plan Through the Agent Loop

A simplified way to picture an agent's run is as a sequence of stages. The agent starts with a task and a tool inventory, which is the set of tools it is allowed to use for that task. It then generates a plan. The plan leads to tool calls, each tool call returns an output, and the agent eventually reflects on whether the work is complete. Each stage can go wrong, and the failures do not all look alike. The diagram below marks where each failure type enters the run. Follow the arrows and notice that the failures branch off at different points and have different consequences for what happens next.

Task and toolinventoryPlan generatedConstraint violationMissing toolWrong tool outputReflection errorRun endsTool callTool outputReflection oncompletionGoal achieved?producesmay break a limitchooses a toolno tool existstool runsoutput is wrongagent continuesclaims successchecks resultyes or no
At which step of the plan, act, and reflect cycle does each failure enter, and what happens to the rest of the run afterward?

Read the diagram as a map of entry points. A constraint violation enters at the plan itself, because the plan can be sound in its destination and still break a budget or a deadline. A missing tool enters at the tool call stage, because the agent has no tool to call for a step the task requires. A wrong tool output enters after a tool runs, when the tool returns an incorrect result. A reflection error enters at the end, when the agent wrongly concludes that it has succeeded. Goal failure appears when the outcome misses the goal, and it can be discovered only by checking the final result against what was asked.

What do you think happens?

An agent is asked to count the items in a list of 10 entries. It reports that it counted 12, and then it states that the task is complete. Which planning failure best describes this?

  • Goal failure

  • Constraint violation

  • Error in reflection

Reveal answer
Answer:

Error in reflection

The agent reports success without having achieved the task. The source describes this as an error in reflection: the agent is convinced it has accomplished the task when it has not. A simple count is enough to expose the problem, because the agent's stated result does not match the actual data.

The counting example shows why the diagram ends with a reflection step. The agent's claim of success is itself an output, and it can be wrong. The count of 12 for a list of 10 is a checkable fact, so a checker can catch it. Because the error sits in the agent's self-assessment, the rest of the run has already been treated as finished. Any downstream steps that rely on the false claim will carry the error forward.

Three Kinds of Planning Failure

The source groups planning failures into three modes. Planning failures can occur because of goal failure or because of a constraint violation, and a third mode, which is easy to miss, comes from errors in the agent's reflection on its own work. The comparison below summarizes what each mode breaks. The distinctions matter because each mode is checked in a different way, and a single pass or fail label would hide which one happened.

Goal failureThe outcome misses the goalConstraint violationA budget or time limit isbrokenReflection errorSuccess is claimed withoutbeing achieved
How do goal failure, constraint violation, and reflection error differ in what they break: the outcome, a limit such as budget or time, or the agent's self-assessment?

Each mode is easy to confuse with the others if you only look at the final text. The subsections below explain each one with a concrete case.

Worked Example: The Hanoi Trip

Worked example

Checking a trip plan against goal and constraints

An agent is asked to plan a trip to Hanoi within a fixed budget. The agent returns a plan for a two-week trip to Hanoi. Does the plan count as a failure, and if so, which kind?

  1. 1
    Check the goal

    The plan does address the destination. Hanoi is the right place, so the goal of planning a trip there is met at the level of destination.

  2. 2
    Check the constraint

    The plan costs far more than the budget allows. The budget is part of the task, so the plan breaks a limit that the task sets.

  3. 3
    Classify the failure

    The plan is a constraint violation. It is not a goal failure, because the goal of a Hanoi trip is addressed. It still counts as a failure, because the plan violates the budget.

  4. 4
    Decide how to test it

    A checker that only tests the destination would pass this plan. The budget must be tested with the same care as the destination.

Result

The plan is a failure of the constraint type. Testing the destination alone would have missed it.

Tool Failures Versus Planning Failures

A tool failure happens when the agent picks the correct tool but the tool's output is wrong. The source gives two examples. An image captioner may return a wrong description, or an SQL query generator may return an incorrect query. A second source of trouble appears when the agent produces only high-level plans and a separate translation module converts each planned action into executable commands. In that setup, the translation step can introduce errors even when the plan itself is sound.

A missing tool failure is the second route to trouble. The source gives a clear case: a task that requires retrieving current stock prices from the internet fails if the agent has no internet access. Missing tool failures are harder to notice than wrong outputs, because nothing is returned at all. Detecting them requires knowing which tools a task should use.

Question to askTool failurePlanning failure
Where does the fault appear?In the tool's output or in the translation stepIn the plan that chose the tool or the steps it lays out
What is the signal?The correct tool returns a wrong output, or no tool exists for a needed stepThe plan misses the goal, breaks a constraint, or the agent misreports completion
How is it tested?Test each tool on its own with its calls and outputs printedCheck the plan against the goal, the constraints, and the reflection claim
Example from the sourceAn SQL query generator returns an incorrect queryA two-week Hanoi trip that breaks the budget

Telling a tool failure apart from a planning failure

When a tool call returns an error, the diagnostic question is whether the fault lies in the tool execution or in the plan that chose the tool. The source's advice is to test each tool on its own, so that a bad result can be traced. Testing a tool only inside the full agent run makes it hard to tell whether a bad result came from the tool or from the planning. If the pipeline includes a translator, build benchmarks that evaluate the translator separately.

Building a Planning Dataset

Spotting failures by reading a handful of outputs is unreliable. A more systematic method is to build a planning dataset in which each example is a tuple made of a task and a tool inventory. For each task, you ask the agent to generate K plans, and then you compute measurements across all of those plans and tool calls. The diagram shows how the pieces relate, and where the failure labels attach.

TaskOne example in the datasetPlanOne of K generated plansTool callA call made inside a planFailure labelPlanning or tool failure,if anyTool inventoryTools allowed for this taskis paired withhas K planscontainsis scored as
How do each task, its available tool inventory, and its K sampled plans relate to one another, and where do failure labels attach?

The structure separates problems that a single pass or fail label would blur together. An invalid tool, a valid tool with bad parameters, and a valid tool with wrong parameter values are three different failures, and each points to a different fix. Because each plan is a separate sample, the dataset also shows how often the same task fails across different attempts, which a single run cannot reveal. The source lists the measurements this makes possible: plan validity, tool-call validity, and parameter errors.

Worked example

Scoring three plans for one task

A task asks the agent to summarize three articles. The tool inventory contains a search tool and a summarizer. The agent generates K equals 3 plans. How would you label them?

  1. 1
    Plan 1

    Searches for the three articles, then summarizes each one with the summarizer. The plan is valid, and every tool call uses an allowed tool with correct parameters. No failure label is attached.

  2. 2
    Plan 2

    Calls a translation tool that is not in the tool inventory. This is an invalid tool, so the tool-call validity measure records a failure for this call.

  3. 3
    Plan 3

    Uses the summarizer, but passes the wrong article identifier as a parameter. The tool is valid, but the parameter value is wrong, so it counts as a parameter error.

  4. 4
    Compare the labels

    Across the three plans, one is clean, one has an invalid tool, and one has a wrong parameter value. The three labels point to different fixes, which a single pass or fail result would not show.

Result

Plan 1 passes, Plan 2 shows an invalid tool, and Plan 3 shows a valid tool with a wrong parameter value.

Measuring Efficiency Against a Baseline

An agent's plan may be valid and use the right tools, yet still be wasteful. Efficiency is a separate question from correctness. The source suggests tracking three quantities: the average number of steps the agent needs to complete a task, the average cost of completing a task, and the time each action takes. Looking at the time per action helps reveal whether a few particular actions dominate the total.

  • Average number of steps needed to complete a task
  • Average cost of completing a task
  • Time taken by each action, to see whether a few actions dominate the total

Raw numbers only mean something against a baseline. The baseline might be another agent or a human operator. A human and an AI work in very different ways, so a result that looks inefficient for a person can be sensible for a machine, and the reverse can also be true. Visiting 100 web pages would be a heavy burden for a human who can open only one page at a time, yet it is trivial for an AI agent that can process many pages at once. Compare like with like, and judge efficiency by what each kind of worker can actually do.

Why Memory Makes Failures Spread

Many of the failures above depend on what the agent is able to keep track of while it works. The source ties this to memory, which it defines as mechanisms that allow a model to retain and utilize information. An agentic system needs memory to store many kinds of material. The source links this to evaluation: because agents keep plans, tool inventories, and tool outputs in memory, a failure in one of those stored items can carry forward into later steps. A wrong tool output that is stored and reused can therefore affect several later decisions, not only the one step where it appeared.

Mistakes When Evaluating Agents

  • Common mistake

    Judging a plan by how well it reads

    What it looks like

    A detailed, confident plan is accepted because it is well organized.

    Why it fails

    Fluency says nothing about whether the plan achieves the goal, respects limits, or uses tools correctly.

    Do this instead

    Check the outcome, the constraints, and the tool use separately.

  • Common mistake

    Testing only the destination of a plan

    What it looks like

    A Hanoi trip plan is passed because it names the right city, even though it costs far more than the budget.

    Why it fails

    Constraints are part of the task, so a plan can fail on a limit even when its goal is addressed.

    Do this instead

    Test budget, time, and other constraints with the same care as the goal.

  • Common mistake

    Forgetting time as a constraint

    What it looks like

    A grant proposal delivered after its deadline is scored as a success because it is well written.

    Why it fails

    In some tasks the value of the result drops as time passes.

    Do this instead

    Ask whether timing matters for the task before deciding that a result is acceptable.

  • Common mistake

    Trusting the agent's claim of completion

    What it looks like

    An agent reports a count that does not match a list of 10 items, and the run is marked finished.

    Why it fails

    An error in reflection means the agent believes it succeeded when it did not.

    Do this instead

    Verify the claimed result against the underlying facts.

  • Common mistake

    Blaming the tool for a planning fault, or the reverse

    What it looks like

    A bad result is blamed on a search tool when the plan chose the wrong query parameters.

    Why it fails

    A tool failure and a planning failure have different causes and different fixes.

    Do this instead

    Test each tool on its own with its calls and outputs printed, then review the plan that chose it.

  • Common mistake

    Scoring efficiency without a baseline

Practice: Classify and Measure

MEDIUM

An agent is asked to book a meeting room for a team of six people at a time before 3 PM, using only a room-booking tool. The agent books a room for four people, reports that the booking is complete, and the room is available after 3 PM. Identify each failure. Which one is a goal failure, which is a constraint violation, and which is an error in reflection? Then explain whether the booking problem is a tool failure or a planning failure.

Hints
  • Check the goal first: does the outcome match what the task asked for?
  • Check the limits next: a time and a capacity are both constraints in this task.
  • Look at the final message: does the agent claim success that the facts do not support?
MEDIUM

Design a planning dataset for three tasks, each with a small tool inventory. For each task, list the tuple (task, tool inventory), state K, and name the failure label you would attach to a plan that calls a tool not in the inventory.

Hints
  • Each example is one tuple of a task and its tool inventory.
  • Failure labels attach to individual plans and tool calls, not to the task as a whole.

Summary of the Evaluation Checklist

  1. 1
    A planning failure occurs when the plan does not achieve the goal, violates a constraint such as budget or time, or rests on an error in reflection about completion.
  2. 2
    A planning dataset of (task, tool inventory) tuples, with K plans per task, measures plan validity, tool-call validity, and parameter errors across many examples.
  3. 3
    Tool failures come from correct tools returning wrong output or from missing tools; each tool should be tested on its own, and planning failures should be checked in the plan itself.
  4. 4
    Efficiency is measured by steps, cost, and time per action, and it only means something when compared with a baseline on the same tasks.

At a glance

  • A planning failure is goal failure, constraint violation, or an error in reflection, and each one breaks a different thing: the outcome, a limit, or the agent's self-assessment.
  • A planning dataset of (task, tool inventory) tuples with K plans per task lets you score plan validity, tool-call validity, and parameter errors across many examples.
  • Tool failures come from wrong outputs or missing tools, and each tool should be tested separately from the planning that chose it.
  • Efficiency is measured by steps, cost, and time per action, and it becomes meaningful only when compared with a baseline on the same tasks.

Related concepts

More concepts starting with T