Skip to main content
Deferred tools are available to the agent but their complete schemas are withheld until the model discovers them. This reduces the initial tool list for agents with many optional capabilities.

Mark a tool as deferred

Add hastekit.WithDeferred(true) to a function tool’s constructor. For MCP, pass mcpclient.WithDeferredTools("search_issues", "list_projects"); use the original server names, even when the connector has a prefix. Enable prompts.ResolveDeferredTools, or the standard resolver chain, on the system prompt. The agent adds its tool-search mechanism when deferred tools are present; the resolver explains that mechanism to the model.

Execution behavior

The model discovers relevant tools, obtains their full schemas, and calls them normally. Deferral is not background execution, lazy authentication, or an access-control boundary. The application still configures the tools and connectors, and MCP discovery may still contact the server. Use it for large tool catalogs where most runs need only a subset. Keep a small, frequently used tool set visible directly. Do not defer a tool merely to hide a sensitive capability: filter it out or enforce authorization in middleware instead. A deferred tool can also require approval. Discovering its schema does not grant approval to execute it.