Skip to content

Can MCP tools accept files (e.g. PDF) along with JSON arguments? #232

@wassay13

Description

@wassay13

I have a question about tool input capabilities.

Suppose I’m building an agent that needs to call a tool with both:
1. A file (for example, a PDF)
2. Additional JSON arguments (e.g. a stringified JSON object with options or metadata)

From the docs and examples I’ve seen, most MCP tools define inputs as JSON schemas, and often refer to files by path or URL. However, I haven’t found a clear answer on whether a tool can directly accept a file as part of the tool call:
• Is it possible to send raw file content (e.g. PDF bytes or base64 string) inside the tool arguments?
• Or is the intended pattern to upload a file elsewhere (filesystem, URL, etc.) and then just pass a reference/path through the MCP tool call?
• Are there any size limitations or best practices if base64 encoding is used for this?

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