gridstack_is_area_empty
Check if a specific grid area is empty by providing coordinates and dimensions to verify widget placement availability.
Instructions
Check if an area is empty
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X position | |
| y | Yes | Y position | |
| w | Yes | Width | |
| h | Yes | Height |
Implementation Reference
- src/tools/index.ts:1074-1081 (handler)The handler function that implements the core logic for the gridstack_is_area_empty tool by generating the appropriate GridStack JavaScript code call.private async isAreaEmpty(params: any): Promise<string> { const { x, y, w, h } = params; return this.utils.generateGridStackCode("isAreaEmpty", { area: { x, y, w, h }, code: `const isEmpty = grid.isAreaEmpty(${x}, ${y}, ${w}, ${h});`, }); }
- src/tools/index.ts:546-559 (registration)Registration of the tool in the listTools() method, defining its name, description, and input schema.{ name: "gridstack_is_area_empty", description: "Check if an area is empty", inputSchema: { type: "object", required: ["x", "y", "w", "h"], properties: { x: { type: "number", description: "X position" }, y: { type: "number", description: "Y position" }, w: { type: "number", description: "Width" }, h: { type: "number", description: "Height" }, }, }, },
- src/tools/index.ts:825-826 (registration)Switch case in callTool() method that dispatches execution to the specific handler for this tool.case "gridstack_is_area_empty": return this.isAreaEmpty(args);