ai-core/tool-calling

Coordinate server and client tool calling workflows for AI chats.

3.0k|295|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/TanStack/ai --skill ai-core-tool-calling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-core/tool-calling
Source: https://github.com/TanStack/ai/tree/main/packages/typescript/ai/skills/ai-core/tool-calling
Command: npx skills add https://github.com/TanStack/ai --skill ai-core-tool-calling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tool calling often breaks because server-only tool implementations, client callbacks, approval flows, and lazy discovery must remain aligned, and this skill explains how to share definitions and orchestrate them so server chat agents and client interfaces react in sync.

Core Features & Use Cases

  • Shared definitions with Zod schemas describe tool inputs and outputs once for both server execution and client invocation so adapters see the same contract.
  • Server-only tools, client-only tools, and hybrid definitions teach how to register tools with chat routes and expose client callbacks that render tool call parts in the UI and update state.
  • Approval flows and lazy discovery sections show how to pause execution for user consent, respond with approval data, and let seldom-used tools register themselves on demand.

Quick Start

Ask the AI to call getProducts and updateCartUI so the model fetches products and refreshes the cart counter.

Frequently Asked Questions about ai-core/tool-calling

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

FAQPage Schema
How do I coordinate AI tool calling between server functions and client callbacks?

AI tool calling coordination connects server-only deterministic functions with client callbacks using shared Zod schemas, ensuring both environments react in sync during chat sessions.

How do I add user approval flows before an AI chat executes a tool?

Tool approval flows pause AI execution to request user consent, letting you intercept the call and respond with approval data before the server resumes processing the tool.

What is lazy discovery for AI chat tools and when do I need it?

Lazy discovery lets seldom-used tools register their schemas on demand during streaming chat sessions, reducing initial payload size while keeping tool definitions available when needed.

How do I validate inputs and outputs for AI chat tools?

You validate inputs and outputs by defining Zod schemas once as shared definitions, ensuring both server execution and client invocation adhere to the same data contract.

How do I render tool call parts in the UI during a streaming chat?

You expose client callbacks that render tool call parts in the UI and update state, allowing hybrid tool definitions to bridge server chat agents and client interfaces.

Can I use TanStack AI adapters to manage server-client tool definitions?

Yes, TanStack AI adapters orchestrate server-client tool definitions during streaming chat sessions, handling Zod validation, approval responses, and lazy schema discovery seamlessly.