Prompt EngineeringTechniques

Prompting for tool use

How to describe tools and agentic loops so the agent calls the right one at the right time.

When an agent has tools — search, a shell, an API — the prompt's job shifts. You're no longer just asking for an answer; you're shaping when and how the agent reaches for a capability. The same principles apply, aimed at the tool boundary.

The description is the interface

An agent decides whether to call a tool almost entirely from its name and description. Treat that description like the description frontmatter of a skill: say when to use it, concretely, including when not to. A vague tool description produces a tool that's called at the wrong moments.

Prefer few sharp tools over many fuzzy ones

Overlapping tools force the agent to guess. Each tool should have a distinct, non-overlapping job. If two tools could plausibly do the same task, the agent will sometimes pick wrong — merge them or sharpen the boundary.

Close the loop with results

Agentic work is a loop: call a tool, read the result, decide the next move. Prompt for the whole loop — tell the agent to check the tool's output before continuing, and what to do when a call fails, rather than assuming success and marching on.

Grounding beats guessing

A tool that fetches the real state (the actual file, the live status) turns a guess into a fact. Prompt the agent to look before it claims — the same verify-don't-assume discipline, applied to tools.