-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationneeds reproneeds additional information to be able to reproduce bugneeds additional information to be able to reproduce bug
Milestone
Description
Describe the bug
Unable to send ray bytes / ArrayBuffer / Buffer to mcp server, pydantic validation failes
To Reproduce
Steps to reproduce the behavior:
- read file from html as buffer send it to client and use callTool method to upload file and it fails
Expected behavior
- read file from from user in html, using FileReader [ readAsDataURL, readAsArrayBuffer]
- solution 1 troed : readAsDataURL covert to base64 then Buffer.from(data, 'base64') send to mcp server fails
- solution 2 tried : readAsDataURL covert to base64 then Buffer.from(data, 'base64') then bytes = new Uint8Array(tmp.buffer, tmp.byteOffset, tmp.byteLength) still fails.
- readAsArrayBuffer sending this directly still fails and tried few more soultion none worked.
Logs
{
type: "text",
text: 'Error executing tool upload_file_and_email: 1 validation error for upload_file_and_emailArguments files..env\ Input should be a valid bytes [type=bytes_type, input_value={'0': 65, '1': 90, '2': 8....., '333': 109, '334': 34}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/bytes_type`,
}
Additional context
- at last modified server to hanle base64 directly instead of bytes.
- i think it call_tool method convert it to stre
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationneeds reproneeds additional information to be able to reproduce bugneeds additional information to be able to reproduce bug