document_import
Imports PNG, JPG, WebP, SVG, PSD, and Moho files into live Moho projects, creating editable ImageLayers or using SVG/FileImport controls for scaling, consolidation, and layer placement.
Instructions
Import a PNG/JPG/WebP image directly as a live ImageLayer, import SVG headlessly through Moho 14.4 SS_SVGImport (with scaling/consolidation controls), or import PSD/Moho files via FileImport.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "document_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Moho FileImport mode (default 0) | |
| name | No | Optional layer name for imported ImageLayer | |
| path | Yes | Absolute file path to import | |
| minify | No | For .svg via SS_SVGImport: enable layer consolidation (default: true) | |
| recenter | No | For .svg via SS_SVGImport: recenter artwork in canvas | |
| scaleMode | No | For .svg via SS_SVGImport: canvas-fit or asset-relative scaling preset | |
| asImageLayer | No | Create an ImageLayer and call SetSourceImage (default true for raster images) | |
| expandGroups | No | For .svg via SS_SVGImport: expand imported group hierarchy | |
| minifyGroups | No | For .svg via SS_SVGImport: ungroup single-child groups | |
| minifyLayers | No | For .svg via SS_SVGImport: combine adjacent vector layers | |
| parentLayerId | No | Optional parent Group/Bone layer ID | |
| parentLayerName | No | Optional parent Group/Bone layer name | |
| requireSvgBridge | No | Return an error instead of falling back to FileImport if SS_SVGImport fails | |
| useNativeSvgImport | No | Force Moho's legacy FileImport instead of SS_SVGImport for .svg | |
| minifyLayersUnnamed | No | For .svg via SS_SVGImport: consolidate only unnamed layers |