create_client_script
Create a new ERPNext Client Script for a target DocType using standard or smart mode, with smart mode validating the script before creation.
Instructions
Create a new Client Script in ERPNext (unified – use mode = 'standard' | 'smart')
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": {
"script": "<script>",
"dt": "<dt>"
},
"name": "create_client_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dt | Yes | Target DocType | |
| mode | No | Creation mode: 'smart' (default) or 'standard' (legacy). Smart mode performs validation. | smart |
| name | No | Script name (optional) | |
| view | No | View (Form/List, optional) | |
| script | Yes | Script code | |
| enabled | No | Enabled (1/0, optional) | |
| script_type | No | Script type (optional) |