[KongchangAI]
· 1 min read· 866 words

AI SDK xAI Module Update: MCP Tool Call Parameter Fix

AI SDK xAI Module Update: MCP Tool Call Parameter Fix

@ai-sdk/xai@3.0.154 fixes MCP tool call parameter loss, restoring the input field.

@ai-sdk/xai@3.0.154 is a patch version with only one change, with the core fix from commit b8cb0cd: in mcpServer tool calls, MCP call parameters are preserved in the input field rather than the previous empty object. Although the issue is small, it directly affects the observability of tool call chains, the feasibility of building evaluation sets from historical call records, and the completeness of context review in multi-turn Agent scenarios. Since it's a behavior correction rather than a new feature, a patch version release aligns with versioning strategy. The article recommends that projects involving mcpServer tool calls and reading the input field upgrade as soon as possible and verify parameter structures in a test environment; projects not relying on MCP can handle it alongside routine dependency updates.

rss source: @ai-sdk/xai@3.0.154

The xAI integration module of AI SDK has released a patch version @ai-sdk/xai@3.0.154. This update is small in scope, containing only a single patch-level change, but the issue it fixes is quite critical for developers using MCP (Model Context Protocol) tool calls.

What Was Fixed: MCP Call Parameters No Longer Lost

According to the release notes on GitHub, the core change in this patch comes from commit b8cb0cd: in mcpServer tool calls, MCP call parameters are now preserved in the input field, rather than returning an empty object as before.

The problem sounds minor, but the actual impact is significant. When AI SDK connects to xAI models, if developers integrate external tools through mcpServer, the input field in the tool call result should carry the call parameters passed by the model. Previously, this field was set to an empty object, meaning that while the upper-layer application received a call record, it could not see what parameters were actually passed in that call—making debugging impossible to trace and log analysis missing key information.

This patch restores these parameters to input, forming a complete closed loop between tool call inputs and outputs. For engineering teams that rely on call chains for auditing, replay, or error localization, this is a directly perceivable improvement.

MCP (Model Context Protocol) is a standardized protocol proposed and open-sourced by Anthropic, aimed at unifying the interaction between large language models and external tools and data sources. In the MCP architecture, the model initiates tool calls to an MCP Server through structured JSON-RPC messages, with requests carrying tool names and parameter objects; the Server executes and returns structured results. AI SDK, as a client-side wrapper layer, is responsible for converting the model's tool call intent into MCP protocol messages and parsing the Server's responses back into objects consumable by the upper-layer application. Therefore, the input field is essentially a snapshot of the call parameters generated by the model—a bridge connecting model intent with actual execution. Understanding this is essential to see why an empty field breaks the traceability of the entire call chain.

Why Tool Call Parameters Deserve a Dedicated Patch Release

The original intent of MCP design is to let models invoke external capabilities in a standardized way, and tool call parameters are the concrete expression of model intent. The cascading effects of parameter loss often exceed expectations:

  • Observability gap: Monitoring dashboards can only show "a tool was called" but not "with what parameters," leaving anomaly investigation to guesswork.
  • Evaluation and regression difficulties: When building evaluation sets from historical call records, records lacking input parameters have almost no reusable value.
  • Limited multi-turn Agent scenarios: Agents need to review details of previous tool calls in subsequent turns; empty objects break the continuity of context.

Judging from the wording of the release notes, this fix targets exactly the specific behavior of "returning an empty object"—it's a behavior correction rather than a new feature, making a patch version release a reasonable versioning strategy.

AI SDK is an open-source TypeScript toolkit maintained by Vercel that provides a unified calling interface for different model providers (OpenAI, Anthropic, xAI, Google, etc.). @ai-sdk/xai is the adapter for xAI (Grok series models) within it. AI SDK internally defines a provider-agnostic message and tool call structure, and each adapter is responsible for bidirectional mapping between the provider's native format and this unified structure. Because of this, filling or omitting fields at the adapter layer directly affects all upper-layer consumers—even if the protocol itself hasn't changed, a small oversight in the adapter can cause downstream code to receive structures that don't match expectations. This is also why fixing the tool call return structure, despite involving only one line of logic, warrants a separate release and regression testing.

Version Background and Upgrade Recommendations

This version was automatically published by github-actions at 23 Nov 21:07, corresponding to a release point after 3628 cumulative commits on the main branch. The commit carries a GitHub verified signature (GPG key ID: B5690EEEBB952194), and the release process itself follows the repository's signing standards.

Recommendations for consumers are straightforward:

  1. If your code path involves mcpServer tool calls and reads the input field from return results, you should upgrade to 3.0.154 as soon as possible.
  2. If you don't currently rely on MCP tools and have no logic parsing input, this upgrade brings no additional migration cost and can be handled alongside routine dependency updates.
  3. After upgrading, it's recommended to verify the complete tool call chain in a test environment to confirm that input contains the expected parameter structure rather than an empty object.

Interestingly, patch versions typically don't introduce breaking changes, but the tool call return structure is a part that downstream code can easily depend on implicitly. Running relevant unit tests after upgrading is more reliable than just reading the changelog.

Summary

@ai-sdk/xai@3.0.154 is a typical highly targeted minor version: only one change, fixing the issue of MCP tool call parameters being discarded. It reminds us that the evolution of infrastructure like AI SDK often hides in patch versions—paying attention to behavior fixes in the changelog is more effective at avoiding pitfalls than just watching major version numbers.

#AI SDK#xAI#MCP#tool call#patch release#@ai-sdk/xai
Share:

Related articles