Agent( )
Pattern
INT·Jun 26

Call Options: prepareCall

Dynamically configure one ToolLoopAgent per request with callOptionsSchema and prepareCall. A customer-support agent rewrites instructions, gates tools, tunes reasoning effort, and injects RAG context based on account tier and urgency.

View Full Pattern on Desktop
Call Options: prepareCall preview

Problems Solved

  • Configure one agent dynamically per request instead of many agents
  • Inject per-user RAG context into instructions at runtime
  • Gate tools by account tier with activeTools
  • Tune reasoning effort by request urgency

Use Cases

  • Multi-tier customer support agents
  • Per-user RAG injection
  • Role-based tool access
  • Runtime model and provider option selection

AI SDK APIs

ToolLoopAgentcallOptionsSchemaprepareCallactiveToolsproviderOptionstoolgateway

Tags

aiagentscall-optionsprepare-calldynamic-configragtool-loop-agentai-sdkagent-api

Requirements

Node.js
24+
Memory
512MB
Other
  • OpenAI API key

Environment Variables

External Services

openai

Ready to use?

View the full interactive pattern with live preview and copy the source code.

View Pattern on Desktop
End of Pattern