# Tool calling is broken for Codex with LLM proxies

**URL:** <https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911>\
**Category:** Ask the Community\
**Tags:** language-model-service\
**Created:** [July 9, 2026, 2:04am UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911 "2026-07-09T02:04:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeStrap](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/codestrap/32/138_2.png) [@CodeStrap](https://community.palantir.com/u/CodeStrap)\
**Post date:** [July 9, 2026, 2:04am UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/1 "2026-07-09T02:04:31Z")

</div>

The LLM proxy for OpenAI models at `/api/v2/llm/proxy/openai/v1` break tool calling in newer version of Code. This matters because the supply chain attacks on TanStack caused certificates to be reused which will eventually cause all users to have their malware detectors triggered and force an upgrade to a version where the certificate signatures match. Below is a full explination of the issue and how I fixed it with a LLM proxy that rewrites the calls locally before sending to AIP

The issue was a **\*\*shape mismatch\*\*** between Codex, the Palantir OpenAI-compatible proxy, and MCP tool routing.

Codex sent the MCP server to the model as a **\*\*namespace tool\*\*** :

```json
{

  "type": "namespace",

  "name": "mcp__codestrap_local_dev",

  "tools": [

    {

      "type": "function",

      "name": "palantir_broker"

    }

  ]

}

```

But the Palantir proxy/model response came back as a plain function call:

```json
{
  "type": "function_call",

  "name": "palantir_broker",

  "arguments": "{...}"
}

```

Codex could not route that, so it failed with:

```auto
unsupported call: palantir_broker

```

The fix was to create my own LLM proxy to rewrite tool calls:

```typescript
// Palantir response -> Codex

// Add Codex's MCP routing namespace.

if (

  next.type === 'function_call' &&

  next.name === 'palantir_broker' &&

  typeof next.namespace !== 'string'

) {

  next.namespace = 'mcp__codestrap_local_dev';

}

```

That let Codex route the call to the MCP server. Your MCP logs confirmed it hit:

```auto
[MCP TOOL CALL] palantir_broker sessionId=new

```

Then the next request back to Palantir failed because Codex included its internal field:

```json
{

  "namespace": "mcp__codestrap_local_dev"

}

```

Palantir rejected that with:

```auto
unrecognizedProperty=namespace

```

So the final fix was bidirectional:

```typescript
// Palantir response -> Codex

// Add namespace so Codex can route MCP calls.

function_call.namespace = 'mcp__codestrap_local_dev';

// Codex request -> Palantir

// Strip namespace because Palantir does not accept it.

delete function_call.namespace;

```

In plain English:

**\*\*Codex needs `namespace` to dispatch MCP calls. Palantir rejects `namespace` as an unknown request field. The proxy now adds it only on responses going to Codex and removes it on requests going back to Palantir.\*\***

Can you please upgrade your proxies and fix tool calling so this is no longer necessary.

---

<div class="post-metadata">

**Author:** ![malbin](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/malbin/32/2_2.png) [@malbin](https://community.palantir.com/u/malbin)\
**Post date:** [July 10, 2026, 2:51pm UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/2 "2026-07-10T14:51:11Z")

</div>

Hey @CodeStrap - the change here is in flight. We’ll update this thread when it’s released

---

<div class="post-metadata">

**Author:** ![kopach](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/kopach/32/7949_2.png) [@kopach](https://community.palantir.com/u/kopach)\
**Post date:** [July 16, 2026, 5:17pm UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/3 "2026-07-16T17:17:44Z")

</div>

hey @malbin , any updates or ETA on this?

---

<div class="post-metadata">

**Author:** ![jiaweiwu](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@jiaweiwu](https://community.palantir.com/u/jiaweiwu)\
**Post date:** [July 21, 2026, 12:42pm UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/4 "2026-07-21T12:42:37Z")

</div>

Hello! We are releasing a change to support `namespace`s in the `function_call` tool. It should be available to your enrollments soon, if it isn’t already.

---

<div class="post-metadata">

**Author:** ![CodeStrap](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/codestrap/32/138_2.png) [@CodeStrap](https://community.palantir.com/u/CodeStrap)\
**Post date:** [July 29, 2026, 7:52pm UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/5 "2026-07-29T19:52:12Z")

</div>

Awesome, we will start testing.

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [October 29, 2026, 3:52am UTC](https://community.palantir.com/t/tool-calling-is-broken-for-codex-with-llm-proxies/6911/6 "2026-10-29T03:52:54Z")

</div>

Closed on October 29, 2026, 3:52am UTC

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.
