tool-call-flow

Define the four-phase tool-call cycle across vendor encodings.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill tool-call-flow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tool-call-flow
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/tool-call-flow
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill tool-call-flow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tool-calling systems often fail in subtle ways because the model, runtime, message history, and tool-result pairing must follow a precise cycle; this Skill explains that protocol so teams can implement and audit it correctly.

Core Features & Use Cases

  • Defines the four-phase tool-call cycle: declaration, request, execution, continuation.
  • Clarifies message-history as the source of truth for how tool calls and results are represented across turns.
  • Compares vendor protocol encodings (Anthropic tool-use, OpenAI function-calling, MCP, Gemini function calling) while preserving the same underlying cycle.
  • Covers parallel tool calls and streaming tool calls with correctness implications and dependency limits.
  • Specifies failure encoding so errors remain tool-result messages that the model can read and recover from.
  • Distinguishes model intent from runtime execution to maintain auditability, composability, and recoverability.

Quick Start

Ask an AI runtime engineer: “Explain the exact four-phase tool-call cycle and show how a tool-result must be appended to the message history before the next model turn, including how failures are encoded.”

Frequently Asked Questions about tool-call-flow

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

FAQPage Schema
What is the correct four-phase cycle for LLM tool calling?▼

The tool calling cycle follows a declare-request-execute-continue structure, ensuring the runtime appends ID-paired tool-call and tool-result messages to the history before the next model turn. This protocol maintains deterministic loop control and auditability across vendor encodings.

How do I handle tool calling errors so the model can recover?▼

Tool calling errors should be encoded as tool-result messages within the message history, allowing the model to read the failure and recover. This preserves the protocol-level cycle and keeps model intent distinguishable from runtime execution.

Does the tool-call protocol work across Anthropic, OpenAI, and Gemini encodings?▼

Yes, the tool-call protocol applies across Anthropic tool-use, OpenAI function-calling, MCP, and Gemini function calling. It preserves the same underlying declare-request-execute-continue cycle and ID-paired message history contract across all vendor encodings.

How do parallel tool calls work in function calling systems?▼

Parallel tool calls execute multiple requests within the same cycle, but require strict dependency limits and correct ID-paired tool-result messages. The message history serves as the source of truth to maintain correctness across concurrent streaming and execution.

Why do my function calling conversations break after a tool execution?▼

Function calling breaks when the message history lacks proper ID-paired tool-result messages appended before the next model turn. Maintaining the four-phase declare-request-execute-continue cycle ensures the runtime correctly tracks model intent and execution state.

When do I need strict message history contracts for MCP tool use?▼

Strict message history contracts for MCP tool use are needed when implementing parallel calls, streaming, or error recovery. Defining the protocol-level cycle ensures composability and recoverability across diverse vendor encodings and bounded loop control.