-
Notifications
You must be signed in to change notification settings - Fork 135
How do agent handle pre-filled or user-modified form values? #157
Description
Agents currently lack a reliable mechanism to invoke a tool based on a WebMCP form that contains values either manually filled by the user or pre-populated by the website. The agent is unaware of the form's current state, meaning it cannot confidently fulfill a user instruction like, "Submit this form. Trust me, I've already filled those fields". The agent is forced to rely solely on the schema defined by the form tool itself.
If an input field is marked as required, the agent cannot submit the form because it does not know the current value, effectively blocking the submission even if the form is valid in the browser.
<form toolname="submit_form" tooldescription="Submit form">
<input type="text" name="name" value="John Doe" required>
<button>Submit</button>
</form>- User: Submit this form
- Agent: I can do that. What is the name of the form you would like to submit?
If the required attribute is omitted (or not by the way), the agent may "hallucinate" and generate a random value for the field rather than using the pre-filled value, potentially leading to the submission of incorrect data.
- User: Submit this form
- Agent: Call "submit_form" with {"name":"default_form"}
Ideally, the agent should have a method to submit the form using its current, visible values, despite some fields being required. We should clarify if the WebMCP specification should have a mechanism for this. We could either:
- Allow the agent to "read" the form values directly from the DOM.
- Mandate that the WebMCP specification requires exposing additional tools for each declared form tool, where these additional tools return the current form field values.