From 7f93fbc0f6bf435b64e08b76a6161592b40313ba Mon Sep 17 00:00:00 2001 From: maslin Date: Fri, 10 Jul 2026 07:23:38 +0530 Subject: [PATCH 1/2] fix: align README error table formatting --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7130a8e..6e564b5 100644 --- a/README.md +++ b/README.md @@ -528,18 +528,18 @@ When using the xAI SDK, you may encounter various error codes returned by the AP Below is a table of common gRPC status codes you might encounter when using the xAI SDK: -| gRPC Status Code | Meaning | xAI SDK/API Context | -|---------------------------|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| -| `UNKNOWN` | An unknown error occurred. | An unexpected issue occurred on the server side, not specifically related to the request. | -| `INVALID_ARGUMENT` | The client specified an invalid argument. | An invalid argument was provided to the model/endpoint, such as incorrect parameters or malformed input.| -| `DEADLINE_EXCEEDED` | The deadline for the request expired before the operation completed. | Raised if the request exceeds the timeout specified by the client (default is 1620 seconds, configurable during client instantiation). | -| `NOT_FOUND` | A specified resource was not found. | A requested model or resource does not exist. | -| `PERMISSION_DENIED` | The caller does not have permission to execute the specified operation.| The API key is disabled, blocked, or lacks sufficient permissions to access a specific model or feature. | -| `UNAUTHENTICATED` | The request does not have valid authentication credentials. | The API key is missing, invalid, or expired. | -| `RESOURCE_EXHAUSTED` | A resource quota has been exceeded (e.g., rate limits). | The user has exceeded their API usage quota or rate limits for requests. | -| `INTERNAL` | An internal error occurred. | An internal server error occurred on the xAI API side. | -| `UNAVAILABLE` | The service is currently unavailable. This is often a transient error. | The model or endpoint invoked is temporarily down or there are connectivity issues. The SDK defaults to automatically retrying errors with this status code. | -| `DATA_LOSS` | Unrecoverable data loss or corruption occurred. | Occurs when a user provides an image via URL in API calls (e.g., in a chat conversation) and the server fails to fetch the image from that URL. | +| gRPC Status Code | Meaning | xAI SDK/API Context | +|-----------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------| +| `UNKNOWN` | An unknown error occurred. | An unexpected issue occurred on the server side, not specifically related to the request. | +| `INVALID_ARGUMENT` | The client specified an invalid argument. | An invalid argument was provided to the model/endpoint, such as incorrect parameters or malformed input. | +| `DEADLINE_EXCEEDED` | The deadline for the request expired before the operation completed. | Raised if the request exceeds the timeout specified by the client (default is 1620 seconds, configurable during client instantiation). | +| `NOT_FOUND` | A specified resource was not found. | A requested model or resource does not exist. | +| `PERMISSION_DENIED` | The caller does not have permission to execute the specified operation. | The API key is disabled, blocked, or lacks sufficient permissions to access a specific model or feature. | +| `UNAUTHENTICATED` | The request does not have valid authentication credentials. | The API key is missing, invalid, or expired. | +| `RESOURCE_EXHAUSTED` | A resource quota has been exceeded (e.g., rate limits). | The user has exceeded their API usage quota or rate limits for requests. | +| `INTERNAL` | An internal error occurred. | An internal server error occurred on the xAI API side. | +| `UNAVAILABLE` | The service is currently unavailable. This is often a transient error. | The model or endpoint invoked is temporarily down or there are connectivity issues. The SDK defaults to automatically retrying errors with this status code. | +| `DATA_LOSS` | Unrecoverable data loss or corruption occurred. | Occurs when a user provides an image via URL in API calls (e.g., in a chat conversation) and the server fails to fetch the image from that URL. | These error codes can help diagnose issues with API requests. When handling errors, ensure you check the specific status code to understand the nature of the problem and take appropriate action. From b7d3c3a82e5a0d4ccb9d7ff225b4b5eca910ce77 Mon Sep 17 00:00:00 2001 From: maslin Date: Fri, 10 Jul 2026 07:25:40 +0530 Subject: [PATCH 2/2] fix: remove duplicate parameter documentation in mcp() docstring --- src/xai_sdk/tools.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xai_sdk/tools.py b/src/xai_sdk/tools.py index a5c8701..4e49a70 100644 --- a/src/xai_sdk/tools.py +++ b/src/xai_sdk/tools.py @@ -272,8 +272,6 @@ def mcp( server_url: The URL of the MCP server. server_label: Optional label of the MCP server. This will be used to prefix tool names if provided. server_description: Optional description of the MCP server. - server_label: The label of the MCP server. This will be used to prefix tool names if provided. - server_description: The description of the MCP server. allowed_tool_names: The names of the tools that the model is allowed to call. If empty, all tools are allowed. authorization: The authorization token for the MCP server. extra_headers: The extra headers for the MCP server.