---
library: "bootstrap"
slug: "ToolInvoke"
name: "ToolInvoke"
ref: "ToolInvoke#1096"
hash: "sema:ToolInvoke#mh:SHA-256:1096039316801cc8ef6e2855a6300574bb8596bb8e57c2764fd3bee741fa217e"
type: "Primitives"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke"
---

# ToolInvoke

Execute external tool and observe result

Infrastructure · Primitives

## Mechanism

The actor emits a structured tool call (function name + arguments), validated by [InputGuard](https://semahash.org/vocabularies/bootstrap/patterns/InputGuard.md), execution is delegated to an external runtime, and the observation (result or error) is fed back into the actor's [Context](https://semahash.org/vocabularies/bootstrap/patterns/Context.md). This is the atomic unit of agent-environment interaction. The pattern enables capabilities beyond text generation: code execution, API calls, file operations, web search.

## Invariants

- [Context](https://semahash.org/vocabularies/bootstrap/patterns/Context.md) Inheritance: Tool Execution [Context](https://semahash.org/vocabularies/bootstrap/patterns/Context.md) permissions MUST be <= [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) Constraints. Elevation forbidden.
- Observation Integration: Result must be incorporated into subsequent reasoning
- Sandboxing: Tool execution must respect the capability boundary of its [Sandbox](https://semahash.org/vocabularies/bootstrap/patterns/Sandbox.md) — the boundary is what makes the permission ceiling enforceable rather than advisory
- Schema Conformance: Tool call must match declared function signature

## Failure modes

- Hallucinated Tools: Actor invokes a tool that doesn't exist.
- Argument Mismatch: Tool call has wrong parameter types or missing required fields.
- Observation Blindness: Actor ignores or misinterprets tool output.

## Caution

Tool results are untrusted input — text inside an observation can carry instructions that steer the agent; treat it as data, never as commands.

## Where this came from

—

## Builds on

- [InputGuard](https://semahash.org/vocabularies/bootstrap/patterns/InputGuard.md) (composes_with)
- [Sandbox](https://semahash.org/vocabularies/bootstrap/patterns/Sandbox.md) (references)
- [Context](https://semahash.org/vocabularies/bootstrap/patterns/Context.md) (references)
- [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) (references)

## Used by

- [PolymorphicSolver](https://semahash.org/vocabularies/bootstrap/patterns/PolymorphicSolver.md) (composes_with)
- [PromptChain](https://semahash.org/vocabularies/bootstrap/patterns/PromptChain.md) (composes_with)
- [ReAct](https://semahash.org/vocabularies/bootstrap/patterns/ReAct.md) (composes_with)
- [ToolDiscovery](https://semahash.org/vocabularies/bootstrap/patterns/ToolDiscovery.md) (composes_with)

## Related

- [AgentSandbox](https://semahash.org/vocabularies/bootstrap/patterns/AgentSandbox.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: ToolInvoke#1096
- Hash: sema:ToolInvoke#mh:SHA-256:1096039316801cc8ef6e2855a6300574bb8596bb8e57c2764fd3bee741fa217e

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
