create_form
Create custom form templates for structured data entry in research workflows, defining reusable templates with configurable fields for experiments, protocols, and reports.
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 |
|---|---|---|---|
| fields | No | ||
| name | Yes | ||
| tags | No |
Implementation Reference
- main.py:500-522 (handler)The handler function for the MCP tool 'create_form'. It is registered with the @mcp.tool decorator and implements the tool logic by delegating to the RSpace ELN client's create_form method. The docstring provides input schema details.@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)The @mcp.tool decorator registers the create_form function as an MCP tool with the 'rspace' tag.@mcp.tool(tags={"rspace"})
- main.py:89-90 (helper)Initialization of eln_cli, the RSpace 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
- main.py:22-22 (helper)Import of the rspace_client.eln module aliased as 'e', which provides the ELNClient used in the handler.from rspace_client.eln import eln as e # Electronic Lab Notebook client