ai-sdk-agents

Configure ToolLoopAgent workflows with stopWhen, prepareStep, and callOptionsSchema.

5|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/BjornMelin/dev-skills --skill ai-sdk-agents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk-agents
Source: https://github.com/BjornMelin/dev-skills/tree/main/skills/ai-sdk-agents
Command: npx skills add https://github.com/BjornMelin/dev-skills --skill ai-sdk-agents

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Expert guidance for building AI agents with ToolLoopAgent (AI SDK v6+). Use when creating agents, configuring stopWhen/prepareStep, callOptionsSchema/prepareCall, dynamic tool selection, tool loops, or agent workflows (sequential, routing, evaluator-optimizer, orchestrator-worker). Triggers: ToolLoopAgent, agent loop, stopWhen, stepCountIs, prepareStep, callOptionsSchema, prepareCall, hasToolCall, InferAgentUIMessage, agent workflows.

Core Features & Use Cases

  • Patterns and best practices for constructing multi-tool agents
  • Runtime configuration, type-safety, and UI integration for ToolLoopAgent
  • Real-world examples including routing, orchestrator-worker, and evaluators

Quick Start

Initialize a ToolLoopAgent with a simple multi-step workflow example.

Frequently Asked Questions about ai-sdk-agents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure stopWhen and prepareStep for AI agent workflows?

To configure stopWhen and prepareStep for AI agent workflows, ToolLoopAgent provides patterns for setting step-count limits and pre-step logic. Use stepCountIs to define termination conditions and prepareStep to inject dynamic context before each tool call executes.

What are the best patterns for building multi-tool agent loops?

The best patterns for multi-tool agent loops include sequential workflows, routing, evaluator-optimizer, and orchestrator-worker architectures. ToolLoopAgent supports dynamic tool selection and type-safe callOptionsSchema configuration to manage complex tool execution cycles across production deployments.

Can I use ToolLoopAgent with MCP integration in production?

Yes, ToolLoopAgent supports MCP integration for production-grade agent deployments. The Skill provides migration guidance and best-practice patterns covering MCP integration alongside dynamic tool selection and runtime configuration for real-world agent workflows.

How do I set up callOptionsSchema and prepareCall for dynamic tool selection?

Set up callOptionsSchema and prepareCall for dynamic tool selection by defining a type-safe schema that validates runtime call options. ToolLoopAgent lets you configure prepareCall to inject parameters dynamically, enabling flexible tool selection across multi-step agent workflows.

When should I use routing vs orchestrator-worker patterns for AI agents?

Use routing patterns when your AI agent needs to direct requests to specialized tools based on input type, and orchestrator-worker patterns when tasks require parallel decomposition and result aggregation. ToolLoopAgent supports both for production-grade agent workflows.

Does ToolLoopAgent support InferAgentUIMessage for UI integration?

Yes, ToolLoopAgent supports InferAgentUIMessage for UI integration, enabling type-safe message streaming between agent loops and frontend interfaces. This is part of the runtime configuration and type-safety features covered for real-world agent deployments.