Skip to main content
Glama

gridstack_is_area_empty

Check if a specified grid area is empty by providing coordinates and dimensions to verify available space for widget placement.

Instructions

Check if an area is empty

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX position
yYesY position
wYesWidth
hYesHeight

Implementation Reference

  • The handler function that implements the core logic of the "gridstack_is_area_empty" tool. It destructures the input parameters (x, y, w, h) and uses GridStackUtils.generateGridStackCode to produce JavaScript code calling GridStack's grid.isAreaEmpty method, which checks if the specified grid area is empty.
    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});`, }); }
  • The input schema for the tool, specifying required numeric parameters x, y, w, h with descriptions for the area to check.
    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" }, }, },
  • Tool registration entry in the listTools() array, including 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" }, }, }, },
  • Switch case in callTool method that registers and dispatches calls to the isAreaEmpty handler.
    case "gridstack_is_area_empty": return this.isAreaEmpty(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raghavsharma-simpplr/gridstack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server