{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "ToolDiscovery",
 "ref": "ToolDiscovery#b165",
 "hash": "sema:ToolDiscovery#mh:SHA-256:b1659e870015d2d6e37842f31a0bc1cc2d2d2882aaf6d0bc3b6b1236885890d7",
 "stub": "b165",
 "layer": "Society",
 "type": "Protocols",
 "summary": "Discover and invoke external tools via structured capability manifests",
 "mechanism": "Agent#e127 queries a Discover#f6e0 for capabilities matching its current Task#a850. Registry returns a Card#e4b2 listing available tools with typed input/output schemas. Agent#e127 selects the best match, performs a CompatibilityCheck#7f70 to verify schema alignment, then invokes via ToolInvoke#1096 and observes the typed Result#c02a. If no match is found or CompatibilityCheck#7f70 fails, the agent must FailClosed#dfbc rather than attempt a best-effort invocation. Follows the Model Context Protocol pattern of progressive discovery under ContextFirst#f157 discipline: orient via registry, explore via schema matching, verify via hash comparison.",
 "invariants": [
  "Schema Verification: Tool manifest hash must be verified via CompatibilityCheck#7f70 before invocation",
  "Fail-Closed: On schema mismatch or missing tool, reject via FailClosed#dfbc rather than attempt best-effort",
  "Tool output must conform to declared schema in the Card#e4b2"
 ],
 "parameters": {},
 "signature": [
  "Discover(ToolInvoke)"
 ],
 "preconditions": [
  "Discover#f6e0 accessible",
  "Task#a850 specifies required capability type"
 ],
 "postconditions": [
  "Result#c02a 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#e127 cached old version).",
  "Capability hallucination (tool claims capability it cannot deliver)."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "ToolDiscovery",
 "builds_on": [
  {
   "alias": "card",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Card",
   "ref": "Card#e4b2",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Card"
  },
  {
   "alias": "context_first",
   "relation": "references",
   "library": "bootstrap",
   "slug": "ContextFirst",
   "ref": "ContextFirst#f157",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ContextFirst"
  },
  {
   "alias": "task",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Task",
   "ref": "Task#a850",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Task"
  },
  {
   "alias": "agent",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Agent",
   "ref": "Agent#e127",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Agent"
  },
  {
   "alias": "discover",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Discover",
   "ref": "Discover#f6e0",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Discover"
  },
  {
   "alias": "result",
   "relation": "yields",
   "library": "bootstrap",
   "slug": "Result",
   "ref": "Result#c02a",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Result"
  },
  {
   "alias": "fail_closed",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "FailClosed",
   "ref": "FailClosed#dfbc",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/FailClosed"
  },
  {
   "alias": "compatibility_check",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "CompatibilityCheck",
   "ref": "CompatibilityCheck#7f70",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/CompatibilityCheck"
  },
  {
   "alias": "tool_invoke",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "ToolInvoke",
   "ref": "ToolInvoke#1096",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/ToolInvoke"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "AgentDiscover",
   "ref": "AgentDiscover#b784",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/AgentDiscover"
  }
 ],
 "used_by": [],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/ToolDiscovery",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/ToolDiscovery.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
