gridstack_remove_all
Clear all widgets from a GridStack dashboard to reset the layout or prepare for new content.
Instructions
Remove all widgets from the grid
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gridstack_remove_all"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| removeDOM | No | Remove DOM elements |
Implementation Reference
- src/tools/index.ts:1130-1137 (handler)The handler implementation for the 'gridstack_remove_all' tool. It destructures the input params for removeDOM (default true) and uses a utility to generate a code snippet that calls `grid.removeAll(removeDOM)` from the GridStack library.
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)The input schema and metadata for the 'gridstack_remove_all' tool, defining it as part of the tools registry with name, description, and optional boolean parameter 'removeDOM'.
{ 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-844 (registration)Registration of the tool handler in the central callTool switch statement, dispatching calls to 'gridstack_remove_all' to the removeAll method.
case "gridstack_remove_all": return this.removeAll(args);