Skip to content

[Bug] Error when using Tools/MCP with Anthropic models on Vertex AI #36

Description

@aka012

I am using the latest version of LibreChat with @librechat/agents@3.0.32.

I configured Vertex AI to use Anthropic models (specifically mapped as claude-sonnet-4.5, claude-haiku-4-5, and claude-opus-4-5). While basic chat completions function correctly without any issues, the following error occurs immediately after invoking Tools (e.g., file_search) or using MCP (Model Context Protocol).

Something went wrong. Here's the specific error message we encountered: An error occurred while processing the request: {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_vrtx_011CVUBrrdYh8CvbYcAFXMLQ"}

server logs
{"attemptNumber":1,"cause":{"code":400,"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages: text content blocks must be non-empty\"},\"request_id\":\"req_vrtx_011CVUCCef2Vy7pvbkXwYXtX\"}","status":"Bad Request"},"code":400,"config":{"body":"{\"anthropic_version\":\"vertex-2023-10-16\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"file content plz\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"\"},{\"type\":\"text\",\"text\":\"I\"},{\"type\":\"text\",\"text\":\"'\"},{\"type\":\"text\",\"text\"...","duplex":"half","headers":{},"method":"POST","responseType":"stream","url":{}},"level":"error","message":"[api/server/controllers/agents/client.js #sendCompletion] Operation aborted

Could you please look into this? Any help would be appreciated.

Activity

  1. dustinhealy commented on Nov 25, 2025

    @dustinhealy
    Collaborator

    Hi @aka012,

    Would you mind sharing the part of your librechat.yaml where you configure your Vertex AI endpoint so I can try to reproduce your error?

  2. aka012 commented on Nov 25, 2025

    @aka012
    Author

    Hi @dustinhealy

    In my librechat.yaml, I have configured the titleModel under the google section as follows:

    google:
      titleModel: "claude-haiku-4-5"

    To reproduce this issue:

    • Select the Google Anthropic model in the Agent.

    • Execute a tool such as MCP or file_search.

    Observation: Strangely, the error with file_search seems to occur specifically when using claude-haiku-4-5. Other models behave differently.

  3. dustinhealy commented on Nov 25, 2025

    @dustinhealy
    Collaborator

    Hi @aka012,

    After reviewing this with Danny, the reason for your error is because use of Anthropic models via Vertex AI is not yet implemented in LibreChat.

    However, there is an open PR currently in review which will add this functionality: LibreChat-AI/LibreChat#9798.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions