Catalog/P family/P09
Proposed specificationSource-located exemplarH1

Deferred tool loading

Discover capabilities only when needed.

JOIN POINTtool_discovery_to_invocationRECORD STATUSCandidate · v0.1.0
UML class view for Deferred tool loading, showing participant roles, received calls, and analytical dependencies
FIG. P09 / UML CLASS VIEW
Object interaction diagram for Deferred tool loading, showing role collaboration and a numbered message sequence
FIG. P09 / OBJECT INTERACTIONS
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.
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.

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 SKETCH
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.
CODE DESIGN / PYTHON
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.

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-pythonsrc/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 ↗

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.

ANY-EVIDENCE FAMILY COVERAGE32/36

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 / 41
Canonical source anchoropenai/openai-agents-python 86bd29878b30src/agents/tool.py:1641

Hosted 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\b

This expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.