---
library: "bootstrap"
slug: "ToolDiscovery"
name: "ToolDiscovery"
ref: "ToolDiscovery#b165"
hash: "sema:ToolDiscovery#mh:SHA-256:b1659e870015d2d6e37842f31a0bc1cc2d2d2882aaf6d0bc3b6b1236885890d7"
type: "Protocols"
layer: "Society"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/ToolDiscovery"
---

# ToolDiscovery

Discover and invoke external tools via structured capability manifests

Society · Protocols

## Mechanism

[Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) queries a [Discover](https://semahash.org/vocabularies/bootstrap/patterns/Discover.md) for capabilities matching its current [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md). Registry returns a [Card](https://semahash.org/vocabularies/bootstrap/patterns/Card.md) listing available tools with typed input/output schemas. [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) selects the best match, performs a [CompatibilityCheck](https://semahash.org/vocabularies/bootstrap/patterns/CompatibilityCheck.md) to verify schema alignment, then invokes via [ToolInvoke](https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke.md) and observes the typed [Result](https://semahash.org/vocabularies/bootstrap/patterns/Result.md). If no match is found or [CompatibilityCheck](https://semahash.org/vocabularies/bootstrap/patterns/CompatibilityCheck.md) fails, the agent must [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) rather than attempt a best-effort invocation. Follows the Model Context Protocol pattern of progressive discovery under [ContextFirst](https://semahash.org/vocabularies/bootstrap/patterns/ContextFirst.md) discipline: orient via registry, explore via schema matching, verify via hash comparison.

## Invariants

- Schema Verification: Tool manifest hash must be verified via [CompatibilityCheck](https://semahash.org/vocabularies/bootstrap/patterns/CompatibilityCheck.md) before invocation
- Fail-Closed: On schema mismatch or missing tool, reject via [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) rather than attempt best-effort
- Tool output must conform to declared schema in the [Card](https://semahash.org/vocabularies/bootstrap/patterns/Card.md)

## Signature

- Discover(ToolInvoke)

## Preconditions

- [Discover](https://semahash.org/vocabularies/bootstrap/patterns/Discover.md) accessible
- [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) specifies required capability type

## Postconditions

- [Result](https://semahash.org/vocabularies/bootstrap/patterns/Result.md) returned conforming to tool's declared output schema
- Invocation logged with tool identity and schema hash

## Failure modes

- Registry unavailable (no tools discoverable — must degrade gracefully).
- Schema drift (tool updated its manifest but [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) cached old version).
- Capability hallucination (tool claims capability it cannot deliver).

## Where this came from

—

## Builds on

- [Card](https://semahash.org/vocabularies/bootstrap/patterns/Card.md) (references)
- [ContextFirst](https://semahash.org/vocabularies/bootstrap/patterns/ContextFirst.md) (references)
- [Task](https://semahash.org/vocabularies/bootstrap/patterns/Task.md) (references)
- [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) (references)
- [Discover](https://semahash.org/vocabularies/bootstrap/patterns/Discover.md) (references)
- [Result](https://semahash.org/vocabularies/bootstrap/patterns/Result.md) (yields)
- [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) (composes_with)
- [CompatibilityCheck](https://semahash.org/vocabularies/bootstrap/patterns/CompatibilityCheck.md) (composes_with)
- [ToolInvoke](https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke.md) (composes_with)

## Related

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

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: ToolDiscovery#b165
- Hash: sema:ToolDiscovery#mh:SHA-256:b1659e870015d2d6e37842f31a0bc1cc2d2d2882aaf6d0bc3b6b1236885890d7

## Links

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