The declarative API is what makes this really interesting imo. Adding toolname and tooldescription to existing forms is dead simple — no JS needed, progressive enhancement baked in. That's gonna lower the adoption barrier a ton compared to server-side MCP.
One thing I'm wondering about though: how does this play with SPAs that use controlled components? Like in React, form state lives in component state, not in DOM attributes. Would the browser even see the right values when the agent tries to invoke a declarative tool? Seems like the imperative API would be mandatory for most modern frameworks.
Also the e.agentInvoked flag on submit events is clever. I can already think of use cases where you'd want different validation or logging paths depending on whether a human or agent triggered the action.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The declarative API is what makes this really interesting imo. Adding
toolnameandtooldescriptionto existing forms is dead simple — no JS needed, progressive enhancement baked in. That's gonna lower the adoption barrier a ton compared to server-side MCP.One thing I'm wondering about though: how does this play with SPAs that use controlled components? Like in React, form state lives in component state, not in DOM attributes. Would the browser even see the right values when the agent tries to invoke a declarative tool? Seems like the imperative API would be mandatory for most modern frameworks.
Also the
e.agentInvokedflag on submit events is clever. I can already think of use cases where you'd want different validation or logging paths depending on whether a human or agent triggered the action.