create_document_from_form
Generate structured documents using form templates with predefined fields and validation rules to organize research data in RSpace.
Instructions
Creates a structured document using a form template
Usage: Generate documents with predefined structure and validation Fields: Pre-populate form fields with initial data Returns: Created document information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form_id | Yes | ||
| name | No | ||
| parent_folder_id | No | ||
| tags | No | ||
| fields | No |
Implementation Reference
- main.py:581-602 (handler)The handler function for the 'create_document_from_form' MCP tool. Decorated with @mcp.tool, it invokes the RSpace ELN client to create a new document instance from the specified form template, supporting optional parameters for name, parent folder, tags, and initial field values.@mcp.tool(tags={"rspace"}) def create_document_from_form( form_id: int | str, name: str = None, parent_folder_id: int | str = None, tags: List[str] = None, fields: List[dict] = None ) -> dict: """ Creates a structured document using a form template Usage: Generate documents with predefined structure and validation Fields: Pre-populate form fields with initial data Returns: Created document information """ return eln_cli.create_document( name=name, parent_folder_id=parent_folder_id, tags=tags, form_id=form_id, fields=fields )