ToolDiscovery
Discover and invoke external tools via structured capability manifests
Mechanism
Agent queries a Discover for capabilities matching its current Task. Registry returns a Card listing available tools with typed input/output schemas. Agent selects the best match, performs a CompatibilityCheck to verify schema alignment, then invokes via ToolInvoke and observes the typed Result. If no match is found or CompatibilityCheck fails, the agent must FailClosed rather than attempt a best-effort invocation. Follows the Model Context Protocol pattern of progressive discovery under ContextFirst discipline: orient via registry, explore via schema matching, verify via hash comparison.
Invariants
- Schema Verification: Tool manifest hash must be verified via CompatibilityCheck before invocation
- Fail-Closed: On schema mismatch or missing tool, reject via FailClosed rather than attempt best-effort
- Tool output must conform to declared schema in the Card
Signature
- Discover(ToolInvoke)
Preconditions
Postconditions
- Result 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 cached old version).
- Capability hallucination (tool claims capability it cannot deliver).
Where this came from
—
Builds on
- Card references
- ContextFirst references
- Task references
- Agent references
- Discover references
- Result yields
- FailClosed composes_with
- CompatibilityCheck composes_with
- ToolInvoke composes_with
Related
Identity
- Ref:
ToolDiscovery#b165 - Hash: sema:ToolDiscovery#mh:SHA-256:b1659e870015d2d6e37842f31a0bc1cc2d2d2882aaf6d0bc3b6b1236885890d7
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository