The agent fills in the form fields, but the user must review and click Search to submit. Only toolname and tooldescription are required.

https://eventfinder.com/search

Find Events

Adding toolautosubmit lets the agent fill and submit the form automatically, no manual click required.

https://eventfinder.com/search

Find Events

With a submit event listener you can intercept agent submissions, run your own logic, and return a custom value to the agent via event.respondWith().

https://eventfinder.com/search

Find Events

Declarative WebMCP API Reference

Define a form tool, describe its inputs, and control submission.

Form definition

Attributes on <form>.

toolname
Registers the form with a tool identifier. Must be unique on the page. Use letters, digits, hyphens, underscores, and dots for compatibility with imperative tool names.
tooldescription
Describes what the tool does. Helps the agent decide when and how to use it.
tooltitle
Provides a friendly display name for UIs. The agent still uses toolname for invocation.

Input descriptions

toolparamdescription
Explains what value a field expects. Applies to <input>, <select>, and <textarea>.

Submission contract

toolautosubmit
Allows automatic submission after the agent fills the form. Without it, the user must submit manually.
event.agentInvoked
Indicates an active tool invocation. true even when the user submits after manual review. false for submissions outside a tool invocation.
event.respondWith(promise)
Supplies the tool result. During the submit handler, call preventDefault() first, then pass a Promise resolving to the return value. Requires event.agentInvoked to be true.

Submission rule: Canceling an agent-invoked submission with preventDefault() without calling respondWith() rejects the tool invocation.