create_portal_widget
Create a Service Portal widget on ServiceNow with custom template, styles, and client/server scripts. Input a widget ID and name to generate the component.
Instructions
Create a new Service Portal widget with template, CSS, and scripts (requires WRITE_ENABLED=true)
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": {
"name": "<name>",
"id": "<id>"
},
"name": "create_portal_widget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique widget ID/handle (e.g. "my-custom-widget") | |
| css | No | SCSS/CSS styles | |
| name | Yes | Human-readable widget name | |
| template | No | Angular HTML template | |
| demo_data | No | JSON object with demo data for preview | |
| client_script | No | Client-side controller JavaScript | |
| option_schema | No | JSON array defining widget options | |
| server_script | No | Server-side script (GlideRecord calls) |