Discover tools by metadata, then invoke only the selected tool with its own schema and current permissions. Do not load every tool definition into the prompt by default.Deferred tool loading
Discover capabilities only when needed.
tool_discovery_to_invocationRECORD STATUSCandidate · v0.1.0UML class view
The proposed contract drawn as participant roles, received calls, and numbered dependencies.
Object interactions
The same roles and calls as a class collaboration and a numbered message sequence.
Pointcut
Where the mechanism applies. All four dimensions belong to the proposed match, not just its vocabulary.
- Context
- Available tools are too numerous or expensive to expose eagerly.
- Trigger
- The agent searches, discovers, or lazily resolves a tool.
- Structure
- Discovery descriptor, registry, authorization check, and invocation handle.
- Effect
- Tool schema is loaded on demand and authority is checked before execution.
Protected contract
The obligation that clients, operators, and auditors should be able to rely on.
- Requires
- Tools have discoverable metadata and a stable invocation identity.
- Ensures
- A discovered tool can be invoked once with its own schema and current permissions.
- Invariant
- Lazy loading does not cache a stale authorization decision.
- Violation
- Unknown, stale, or unauthorized tools fail explicitly before side effects.
Negative control
A large static tool list does not satisfy deferred loading.
Variation & lifecycle
The hot spot is admitted only where the protected semantics survive.
Permitted variation
Search tool, registry, namespace, loading scope, and cache policy.
Test obligation
Test discovery latency path, missing tool, revoked permission, and schema refresh.
Evolution question
Did deferred loading add authorization and lifecycle semantics?
Prompt + code design
An illustrative prompt and a small design sketch for the proposed contract. Names and APIs are invented; this is not a repository excerpt.
def call_tool(query, catalog, permissions):
match = catalog.search(query)
if match is None:
return UnsupportedTool(query)
tool = catalog.load(match.id, scope=permissions.scope)
arguments = tool.schema.validate(permissions.arguments)
return tool.invoke(arguments)Illustrative design sketch. Discovery, loading, and authorization are separate steps with separate evidence. This example is a teaching aid, not implementation evidence or a conformance claim.
Detection & matching
The frozen rule that retrieves this record, the canonical source exemplar, and the control that should stay unmatched.
- Join point
tool_discovery_to_invocation- Source locator
- Barbaste et al., §8.3, p. 27 (“Deferred Tool Loading”); Table 11, p. 52; source label
- Lexical cue
(?i)\bdeferred(?:[_-]?\w+)?\b|\blazy[_-]?(?:tool|load)|\btool[_-]?search\b|\bdiscover[_-]?tools\bFrozen expression, v0.1.0. A match is a retrieval cue, not a confirmed implementation.- Aliases
- None
- Canonical exemplar
- openai/openai-agents-python
src/agents/tool.py:1641Support: tests/test_run_internal_items.py:279 - Negative control
- A large static tool list does not satisfy deferred loading.
Scope-anchored review. pohe-agent analyze <repo> --pattern P09 anchors the cue to its enclosing declaration and checks a separate operational signature for all four pointcut dimensions. Missing roles and negative-control risks remain visible; a structural match is not E2/E3. Calibration report ↗
Repository files
Up to five public files retrieved by the frozen cue and pinned to the audited commit. A match is a place to inspect, not a confirmed implementation.
src/agents/tool.py:1641CANONICAL SOURCE02aaif-goose/goosecrates/goose-mcp/src/autovisualiser/templates/assets/mermaid.min.js:13RETRIEVAL CUE03affaan-m/ECCskills/continuous-learning-v2/scripts/instinct-cli.py:137RETRIEVAL CUE04agno-agi/agnolibs/agno/agno/fs/db.py:763RETRIEVAL CUE05Aider-AI/aideraider/main.py:1257RETRIEVAL CUEEvidence & provenance
Each layer answers a different question. Do not substitute retrieval for review.
Source-located exemplar
A concrete source anchor is available for this proposed record. It is one exemplar, not evidence that all repositories—or every contract field—conform.
Review boundary: this candidate and its specification come from an AI-assisted study. Independent human validation remains open.
88.9% of repository families in the frozen panel have at least one current cue, historical cue, or canonical source layer. This is not confirmed prevalence.
Current lexical-cue repositories: 35 / 4186bd29878b30src/agents/tool.py:1641tests/test_run_internal_items.py:279Hosted tool-search surface for deferred tools.
Exploratory retrieval cue Regex / v0.1.0
(?i)\bdeferred(?:[_-]?\w+)?\b|\blazy[_-]?(?:tool|load)|\btool[_-]?search\b|\bdiscover[_-]?tools\bThis expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.