gridstack_get_float
Retrieve the current floating state of widgets in a GridStack dashboard layout to manage responsive drag-and-drop positioning.
Instructions
Get current float state
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:1151-1155 (handler)The main handler function for the 'gridstack_get_float' tool. It generates and returns formatted JavaScript code that retrieves the current float mode state from the GridStack instance using `grid.float()` (returns boolean).private async getFloat(): Promise<string> { return this.utils.generateGridStackCode("getFloat", { code: `const floatMode = grid.float();`, }); }
- src/tools/index.ts:724-731 (registration)Tool registration in listTools(): defines the tool name, description 'Get current float state', and empty input schema (no parameters required).{ name: "gridstack_get_float", description: "Get current float state", inputSchema: { type: "object", properties: {}, }, },
- src/tools/index.ts:852-853 (handler)Switch case in callTool() method that dispatches the tool call to the getFloat() handler.case "gridstack_get_float": return this.getFloat();
- src/utils/gridstack-utils.ts:16-27 (helper)Helper method called by the handler to format the response with operation details, generated code, description, example, and notes.generateGridStackCode(operation: string, params: any): string { const result: GridStackCodeResult = { operation, parameters: params, code: params.code || "", description: this.getOperationDescription(operation), example: this.getOperationExample(operation), notes: this.getOperationNotes(operation), }; return this.formatResponse(result); }
- src/utils/gridstack-utils.ts:369-374 (helper)Description string for the 'getFloat' operation used in response formatting.getFloat: "Get current float mode state", addGrid: "Create a new grid with options and children (static method)", }; return descriptions[operation] || "GridStack operation"; }