Responses API: deferred MCP rediscovery returns server_error when prior tool_search_output is retained

Environment

  • Surface: API (Responses API).
  • Observed: November 16, 2026.
  • Endpoint: POST https://api.openai.com/v1/responses.
  • Model: gpt-6.1-sol; reasoning effort: medium.
  • Streaming enabled; store: false; explicit input history, no previous_response_id.
  • Remote MCP: public endpoint https://mcp.hubspot.com, authorized with a tester’s own read-only grant.
  • Tools: deferred MCP declaration and hosted tool_search.
  • Also reproduced through OpenAI Node SDK 7.57.0; the minimal script below uses only Node’s native fetch.

Bug

Hosted MCP tool discovery succeeds initially, but a subsequent request that retains the completed discovery items can fail immediately after starting another hosted tool_search_call. This reproduces using raw HTTP, without an SDK, application loop, native data calls, or business data in the input.

Reproduction

Save the script below as repro.mjs with Node 24. Supply OPENAI_API_KEY and HUBSPOT_MCP_AUTHORIZATION securely through the environment, using your own credentials, then run:

node repro.mjs

The script makes three requests:

  1. Discover the definition of get_user_details, explicitly requesting no MCP tool execution.
  2. Retain only mcp_list_tools, tool_search_call, and tool_search_output from that response. Ask to discover get_social_channels, which was not in the loaded subset.
  3. Send the same discovery prompt with only mcp_list_tools retained, omitting the previous search call/output.

No identity or CRM results, assistant messages, user history, or captured private fixtures are replayed. The script generates tool definitions afresh, checks that the second target was not already loaded, and rejects runs containing an unexpected native mcp_call. It prints only HTTP status, request ID, event item types, completion status, and error code.

Minimal reproduction script (Node 24, no SDK)
// Discovery-only diagnostic. Credentials come from the operator's environment.
const apiKey = process.env.OPENAI_API_KEY;
const mcpAuthorization = process.env.HUBSPOT_MCP_AUTHORIZATION;
if (!apiKey || !mcpAuthorization) {
  throw new Error('Set OPENAI_API_KEY and HUBSPOT_MCP_AUTHORIZATION securely.');
}

const tools = [
  {
    type: 'mcp',
    server_label: 'hubspot_fixture',
    server_url: 'https://mcp.hubspot.com',
    authorization: mcpAuthorization,
    allowed_tools: { read_only: true },
    require_approval: 'never',
    allowed_callers: ['direct', 'programmatic'],
    defer_loading: true,
  },
  { type: 'tool_search' },
];

async function request(input, label) {
  const response = await fetch('https://api.openai.com/v1/responses', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      model: 'gpt-6.1-sol',
      reasoning: { effort: 'medium' },
      store: false,
      stream: true,
      include: ['reasoning.encrypted_content'],
      max_output_tokens: 1500,
      tools,
      input,
    }),
  });
  if (!response.ok) {
    // Do not print response bodies, requests, headers, or credentials.
    throw new Error(`HTTP ${response.status}; request ${response.headers.get('x-request-id')}`);
  }
  const events = (await response.text()).split(/\r?\n/)
    .filter(line => line.startsWith('data: ') && line !== 'data: [DONE]')
    .map(line => JSON.parse(line.slice(6)));
  const items = events.filter(event => event.type === 'response.output_item.done')
    .map(event => event.item);
  // Never return/log native results or assistant messages, even unexpectedly.
  if (events.some(event => event.item?.type === 'mcp_call')) {
    throw new Error('Unexpected native data call: discard this run.');
  }
  const error = events.find(event => event.type === 'error');
  const terminal = events.find(event => event.type === 'response.failed');
  console.log(JSON.stringify({
    label,
    httpStatus: response.status,
    requestId: response.headers.get('x-request-id'),
    completed: events.some(event => event.type === 'response.completed'),
    itemTypes: events.filter(event => event.type === 'response.output_item.added')
      .map(event => event.item.type),
    errorCode: error?.error?.code ?? error?.code ?? terminal?.response?.error?.code,
  }));
  return items.filter(item => ['mcp_list_tools', 'tool_search_call', 'tool_search_output'].includes(item.type))
    .map(({ created_by, ...item }) => item);
}

const initial = await request([{
  role: 'user',
  content: 'Use tool search to discover get_user_details. Only discover its definition. Do not call it or any other MCP tool. Reply only with the discovered tool name.',
}], 'initial-discovery');
if (!initial.some(item => item.type === 'tool_search_output')) {
  throw new Error('Initial discovery did not complete; no follow-up sent.');
}
const loaded = initial.filter(item => item.type === 'tool_search_output')
  .flatMap(item => item.tools.flatMap(tool => tool.tools ?? [tool]));
if (loaded.some(tool => tool.name === 'get_social_channels')) {
  throw new Error('Target was already loaded; this run cannot test new discovery.');
}
const prompt = {
  role: 'user',
  content: 'Use tool search to discover the get_social_channels tool. It has not been loaded yet. Do not call it or any other MCP tool. Reply only with the discovered tool name.',
};
await request([...initial, prompt], 'retained-discovery');
await request([
  ...initial.filter(item => item.type === 'mcp_list_tools'),
  prompt,
], 'catalogue-only-control');

Diagnostics

Expected: the second request discovers the additional tool and completes, preserving the previously loaded tool definitions.

Actual: HTTP 200, followed by a hosted tool_search_call in progress and an error SSE carrying server_error. There is no completed search output or completed response. Removing only the prior search call/output allows the control request to complete.

When/how often: observed November 16, 2026 (UTC), in the validated three-request reproduction below and the earlier observations listed separately. These samples do not establish an overall failure rate.

Validated with the supplied script:

Request Result OpenAI request ID
Initial discovery Completed req_6ae0ab13f9c744e2b0886e8479552337
Retained discovery history server_error after tool_search_call starts req_76ef765410f94f9392248fba57d9482b
Catalogue-only control Completed req_908e8ba975ba42078186d623e8e505a6

Earlier independent observations on the same date:

Observation OpenAI request ID
Raw HTTP, schema-only rediscovery failure, 15:04:10 UTC req_c56e5ef9aaa644aab5523979b143cf6d
Raw HTTP, catalogue-only control completed, 15:04:45 UTC req_3ca30d6fed8747bbb5303c6640d11358
Standalone SDK follow-up discovery failure req_510f60e091d340209a18ca8e0dd1bb49
Application workflow A: hosted discovery stream failure req_2ac3b517e7f846629ef307af1f08c7f4
Application workflow B: hosted discovery stream failure req_d6f5e6934e32436a87966c8e55b8dfc4

The application workflows can terminate with an incomplete or empty answer. Their private prompts, source results and traces are intentionally excluded; the discovery-only script reproduces independently.

The evidence narrows the trigger to retained discovery state for a deferred MCP namespace. We cannot identify the internal server exception, establish applicability to every MCP server/model, or assert a failure rate. We have not established whether namespace registration is the underlying cause.

Related reports

  • Azure OpenAI: later deferred MCP tool search fails (learn.microsoft.com/en-us/answers/questions/6070989/azure-openai-responses-api-returns-model-error-dur), November 13, 2026. Similar event sequence after an initial successful interaction, but a different model, Azure endpoint, previous_response_id continuation and model_error. Not a confirmed duplicate. The response on that page is labeled AI-generated; it is not evidence of a vendor-confirmed fix or investigation.
  • Codex #44378: repeated tool-search namespace declarations (github.com/openai/codex/issues/44378). Related namespace-history symptom, but client-executed search through a third-party Responses-compatible endpoint and an invalid_request_error; not proof of the same defect.

The tool-search guide (developers.openai.com/api/docs/guides/tools-tool-search#understand-what-gets-loaded) describes loaded tools remaining available across turns through tool_search_output. Please investigate why requesting another hosted search with retained MCP discovery history fails, and confirm whether a different round-trip format is required.

AI disclosure: Codex investigated the failure and wrote and posted this report and reproduction under Tom’s direction.