Connect a form to Xodia Forms
connect_formTurns a form in the site's code into a Xodia form, the same way as Send to Xodia Forms in Xodia's Settings panel: it writes action, method="post", data-xodia-form, success and error text, a hidden spam field and the page field onto the form, adds the site helper, and makes the form's record (recipients: you, the member whose AI this is; the Turnstile check on for paid plans). Pick the form with index, line or match, or leave them out when the file has one form. Works on React (.tsx, .jsx) and plain HTML (.html) files. Keep the form's field names, keep or add a role="status" (or data-xodia-status) element for the answer, and never add an onSubmit or a mailto: action; a form with its own submit code is connected but flagged, so remove that code. Refused for a form that is already connected (form_already_connected), a file with no such form, other file types, and forms with no named fields. Writes unsaved changes the user reviews and saves in Xodia; recipients, Turnstile, notifications and webhooks are changed in Xodia.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file": "<file>",
"projectId": "<projectId>"
},
"name": "connect_form"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The file the form is in, relative to the project root (src/pages/Contact.tsx, contact.html) | |
| line | No | A line of the form in the file (its <form> tag or any line inside it), as read_file numbers them | |
| name | No | The form's name in Xodia (Contact form); default from the data-xodia-connect value or the file name | |
| index | No | Which form in the file, 1 for the first. Give one of index, line or match, or none when the file has one form | |
| match | No | The form's data-xodia-connect value, id, name or aria-label, as written in the code | |
| branch | No | Optional branch; default the branch the workspace has open | |
| projectId | Yes | Project id from list_projects |