Explorer

html-ui.tool-form

description
A form that calls the MCP tool tool of the local server (only in the editable html-ui). fields is the HTML of the inputs, whose names are the arguments. then is the page to open after it succeeds ('' shows the result), confirm is the question asked first ('' asks nothing)
type
Fn(tool: String, then: String, confirm: String, fields: List<@html.node>, button: String) -> List<@html.node>
expression
fn(tool$0, then$1, confirm$2, fields$3, button$4) =>
  [
    @html.element(
      name: "form",
      attributes: [{name: "data-tool", value: $0}, {name: "data-then", value: $1}, {name: "data-confirm", value: $2}],
      children: @core.list-concat(
        left: $3,
        right: [
          @html.text(text: " "),
          @html.element(name: "button", attributes: [], children: [@html.text(text: $4)]),
          @html.element(name: "pre", attributes: [{name: "class", value: "out"}], children: [])
        ]
      )
    ),
    @html.element(
      name: "script",
      attributes: [{name: "type", value: "module"}],
      children: [@html.text(text: @html-ui.tool-script)]
    )
  ]
visibility
public
html-ui.tool-form (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: SqU8c6xI0CloKG7kxYkBzWsRPg_3ihtEXzNkcp1yEPY
content hash: OxQ66sTBJkDL0h_dwVsv78R409BmAkOjUc8dgXRgj04