gridstack_remove_all
Clear all widgets from the grid layout to reset dashboard content or prepare for new widget arrangements. Optionally removes DOM elements for complete cleanup.
Instructions
Remove all widgets from the grid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| removeDOM | No | Remove DOM elements |
Implementation Reference
- src/tools/index.ts:1130-1137 (handler)Handler function that executes the gridstack_remove_all tool by generating JavaScript code to invoke grid.removeAll(removeDOM) using GridStackUtils.private async removeAll(params: any): Promise<string> { const { removeDOM = true } = params; return this.utils.generateGridStackCode("removeAll", { removeDOM, code: `grid.removeAll(${removeDOM});`, }); }
- src/tools/index.ts:691-704 (schema)Input schema definition for the gridstack_remove_all tool, specifying optional removeDOM boolean parameter.{ name: "gridstack_remove_all", description: "Remove all widgets from the grid", inputSchema: { type: "object", properties: { removeDOM: { type: "boolean", description: "Remove DOM elements", default: true, }, }, }, },
- src/tools/index.ts:843-845 (registration)Registration in the central callTool switch statement that dispatches gridstack_remove_all calls to the removeAll handler.case "gridstack_remove_all": return this.removeAll(args);