Skip to content

@maxhealth.tech/prefab / auto / autoForm

Function: autoForm()

ts
function autoForm(
   fields, 
   submitTool, 
   options?): ContainerComponent;

Defined in: auto/form.ts:86

Auto-generate a Form that calls an MCP tool on submit.

Parameters

ParameterType
fieldsAutoFormField[]
submitToolstring
options?AutoFormOptions

Returns

ContainerComponent

Example

ts
autoForm(
  [
    { name: 'email', label: 'Email', type: 'email', required: true },
    { name: 'name', label: 'Full Name', required: true },
  ],
  'create_user',
  { title: 'Create User', submitLabel: 'Create' },
)

Released under the MIT License.