create_form
Define reusable templates for structured data entry in research workflows, enabling consistent capture of experiments, protocols, and reports with customizable fields.
Instructions
Creates a new custom form template for structured data entry
Usage: Define reusable templates for experiments, protocols, reports Fields structure: [ { "name": "Field Name", "type": "String|Text|Number|Radio|Date|Choice", "mandatory": True/False, "defaultValue": "optional default" } ] Returns: Created form information (form will be in NEW state)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| tags | No | ||
| fields | No |
Implementation Reference
- main.py:500-522 (handler)The handler function decorated with @mcp.tool for the 'create_form' MCP tool. It creates a new custom form in RSpace ELN by calling the client library's create_form method.@mcp.tool(tags={"rspace"}) def create_form( name: str, tags: List[str] = None, fields: List[dict] = None ) -> dict: """ Creates a new custom form template for structured data entry Usage: Define reusable templates for experiments, protocols, reports Fields structure: [ { "name": "Field Name", "type": "String|Text|Number|Radio|Date|Choice", "mandatory": True/False, "defaultValue": "optional default" } ] Returns: Created form information (form will be in NEW state) """ return eln_cli.create_form(name=name, tags=tags, fields=fields)
- main.py:500-500 (registration)Registration of the create_form tool using the FastMCP @mcp.tool decorator with rspace tag.@mcp.tool(tags={"rspace"})
- main.py:89-90 (helper)Initialization of the ELN client used by the create_form handler.eln_cli = e.ELNClient(api_url, api_key) # Electronic Lab Notebook operations inv_cli = i.InventoryClient(api_url, api_key) # Inventory Management operations