[BUG] Failed to read pdf file

Resolved 💬 3 comments Opened Nov 16, 2025 by Bowen-Guo Closed Jan 18, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I asked claude code to read an existing pdf file, got 400 error.

What Should Happen?

Should read the pdf file.

Error Messages/Logs

Error messages:

API Error: 400 {"success":false,"error":{"name":"ZodError","message":"[\n {\n "code": "invalid_union",\n "errors": [\n [\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [],\n "message": "Invalid input: expected string, received array"\n }\n ],\n [\n {\n "code": "invalid_union",\n "errors": [\n [\n {\n "code": "invalid_value",\n "values": [\n "text"\n ],\n "path": [\n "type"\n ],\n "message": "Invalid input: expected \"text\""\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "text"\n ],\n "message": "Invalid input: expected string, received undefined"\n }\n ],\n [\n {\n "code": "invalid_value",\n "values": [\n "image"\n ],\n "path": [\n "type"\n ],\n "message": "Invalid input: expected \"image\""\n }\n ],\n [\n {\n "code": "invalid_value",\n "values": [\n "tool_use"\n ],\n "path": [\n "type"\n ],\n "message": "Invalid input: expected \"tool_use\""\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "id"\n ],\n "message": "Invalid input: expected string, received undefined"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "name"\n ],\n "message": "Invalid input: expected string, received undefined"\n },\n {\n "expected": "object",\n "code": "invalid_type",\n "path": [\n "input"\n ],\n "message": "Invalid input: expected object, received undefined"\n }\n ],\n [\n {\n "code": "invalid_value",\n "values": [\n "tool_result"\n ],\n "path": [\n "type"\n ],\n "message": "Invalid input: expected \"tool_result\""\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "tool_use_id"\n ],\n "message": "Invalid input: expected string, received undefined"\n }\n ]\n ],\n "path": [\n 1\n ],\n "message": "Invalid input"\n }\n ]\n ],\n "path": [\n "messages",\n 2,\n "content"\n ],\n "message": "Invalid input"\n }\n]"}}

Steps to Reproduce

Ask claude code to "Read @a_pdf_file_in_your_project"

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.27

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗