Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Response MCP Call Args Delta

From Leeroopedia
Knowledge Sources
Domains API_Types, Responses_API
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete streaming event type for delivering partial argument updates for an MCP tool call provided by the openai-python SDK.

Description

ResponseMcpCallArgumentsDeltaEvent is a Pydantic model emitted when there is a delta (partial update) to the arguments of an MCP tool call. It carries a delta field containing a JSON string with the partial argument update, the item_id identifying the MCP tool call item, the output_index locating it in the response output array, and a sequence_number for event ordering. The type field is always "response.mcp_call_arguments.delta".

Usage

Import this type when building streaming event handlers that need to progressively accumulate MCP tool call arguments as they arrive, for example to display real-time argument construction to the user.

Code Reference

Source Location

Signature

class ResponseMcpCallArgumentsDeltaEvent(BaseModel):
    """Emitted when there is a delta (partial update) to the arguments of an MCP tool call."""

    delta: str
    item_id: str
    output_index: int
    sequence_number: int
    type: Literal["response.mcp_call_arguments.delta"]

Import

from openai.types.responses import ResponseMcpCallArgumentsDeltaEvent

I/O Contract

Fields

Name Type Required Description
delta str Yes A JSON string containing the partial update to the arguments for the MCP tool call.
item_id str Yes The unique identifier of the MCP tool call item being processed.
output_index int Yes The index of the output item in the response's output array.
sequence_number int Yes The sequence number of this event.
type Literal["response.mcp_call_arguments.delta"] Yes The type of the event. Always response.mcp_call_arguments.delta.

Usage Examples

import openai

client = openai.OpenAI()

stream = client.responses.create(
    model="gpt-4o",
    input="Use the MCP tool to fetch data.",
    stream=True,
)

accumulated_args = ""
for event in stream:
    if event.type == "response.mcp_call_arguments.delta":
        accumulated_args += event.delta
        print(f"Arguments so far: {accumulated_args}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment