Implementation:Openai Openai python Response MCP List Tools Completed
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete streaming event type for signaling that the MCP tool list retrieval has completed provided by the openai-python SDK.
Description
ResponseMcpListToolsCompletedEvent is a Pydantic model emitted when the list of available MCP tools has been successfully retrieved. It carries the item_id identifying the MCP tool call item that produced this output, the output_index indicating the processed output item's position, and a sequence_number for event ordering. The type field is always "response.mcp_list_tools.completed".
Usage
Import this type when building streaming event handlers that need to detect when MCP server tool discovery has completed, enabling you to inspect the available tools before proceeding with tool calls.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/response_mcp_list_tools_completed_event.py
Signature
class ResponseMcpListToolsCompletedEvent(BaseModel):
"""Emitted when the list of available MCP tools has been successfully retrieved."""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_list_tools.completed"]
Import
from openai.types.responses import ResponseMcpListToolsCompletedEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| item_id | str | Yes | The ID of the MCP tool call item that produced this output. |
| output_index | int | Yes | The index of the output item that was processed. |
| sequence_number | int | Yes | The sequence number of this event. |
| type | Literal["response.mcp_list_tools.completed"] | Yes | The type of the event. Always response.mcp_list_tools.completed.
|
Usage Examples
import openai
client = openai.OpenAI()
stream = client.responses.create(
model="gpt-4o",
input="List available tools from the MCP server.",
stream=True,
)
for event in stream:
if event.type == "response.mcp_list_tools.completed":
print(f"MCP tool listing completed for item {event.item_id} "
f"at output index {event.output_index}")