gridstack_get_grid_items
Retrieve all items from a GridStack dashboard layout, with option to filter for visible items only.
Instructions
Get all grid items
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| onlyVisible | No | Only return visible items |
Implementation Reference
- src/tools/index.ts:1043-1050 (handler)The handler function that implements the core logic of the 'gridstack_get_grid_items' tool. It extracts the 'onlyVisible' parameter and uses GridStackUtils to generate JavaScript code that calls 'grid.getGridItems(onlyVisible)'.private async getGridItems(params: GetGridItemsParams): Promise<string> { const { onlyVisible = false } = params; return this.utils.generateGridStackCode("getGridItems", { onlyVisible, code: `const items = grid.getGridItems(${onlyVisible});`, }); }
- src/tools/index.ts:475-488 (registration)The tool registration entry in the listTools() method, defining the name, description, and input schema.{ name: "gridstack_get_grid_items", description: "Get all grid items", inputSchema: { type: "object", properties: { onlyVisible: { type: "boolean", description: "Only return visible items", default: false, }, }, }, },
- src/types.ts:256-258 (schema)TypeScript interface defining the input parameters for the gridstack_get_grid_items tool.export interface GetGridItemsParams { onlyVisible?: boolean; }
- src/tools/index.ts:816-817 (handler)The switch case in callTool() that dispatches to the specific getGridItems handler.case "gridstack_get_grid_items": return this.getGridItems(args as GetGridItemsParams);