create_smart_server_script
Create ERPNext server scripts for DocType events, APIs, or schedulers; deprecated, so use create_server_script with mode='smart' for new scripts instead.
Instructions
[DEPRECATED] Use create_server_script with mode='smart' instead – kept for backward compatibility
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_type": "<script_type>",
"script": "<script>"
},
"name": "create_smart_server_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Script name (optional, auto-generated if not provided) | |
| event | No | Event type (for DocType Event scripts) | |
| script | Yes | Python script code | |
| disabled | No | Whether script is disabled (1/0, optional, defaults to 0) | |
| script_type | Yes | Script Type (DocType Event, API, etc.) | |
| api_method_name | No | API method name (for API scripts) | |
| reference_doctype | No | Reference DocType (required for DocType Event) | |
| is_system_generated | No | Is system generated (1/0, optional, defaults to 0) |