-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Description:
Applications that consume file attachments (such as PDF uploads) may need to solicit these from the user during the imperative execution of a WebMCP tool.
Currently, developers can handle this with in-app UI via standard elicitation requests. However, adding explicit support for attachments would streamline workflows—particularly when the media was generated by the browser agent earlier in the conversation—allowing the user to avoid a manual download/upload cycle.
Proposed Solution
Extend the use cases for elicitation to support requesting file attachments directly from the browser agent. By emulating the behavior of <input type="file">, we can provide developers with a familiar way to request and consume files.
For the API, we can add an optional requestAttachments dictionary to the elicitation request. This would signal the browser agent to display a file upload interface. The request would resolve with one or more Blob objects containing the attachment data.
await agent.requestUserInteraction(async () => {
// ...
}, {
requestAttachments: [{
name: 'document',
accept: 'application/pdf'
}]
});