gridstack_float
Control floating behavior for widgets in GridStack dashboards. Enable or disable floating mode to allow widgets to move freely across grid cells for flexible layout arrangements.
Instructions
Enable or disable floating widgets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| val | No | Enable floating (true) or disable (false) |
Implementation Reference
- src/tools/index.ts:946-953 (handler)The main handler function for the 'gridstack_float' tool. It destructures the 'val' parameter and generates JavaScript code to invoke GridStack's 'float' method, either with the provided boolean value or toggling the current state.private async float(params: FloatParams): Promise<string> { const { val } = params; return this.utils.generateGridStackCode("float", { value: val, code: val !== undefined ? `grid.float(${val});` : `grid.float();`, }); }
- src/tools/index.ts:304-316 (schema)Tool definition in listTools(), including the name, description, and input schema for the 'gridstack_float' tool.{ name: "gridstack_float", description: "Enable or disable floating widgets", inputSchema: { type: "object", properties: { val: { type: "boolean", description: "Enable floating (true) or disable (false)", }, }, }, },
- src/tools/index.ts:789-790 (registration)Registration in the callTool switch statement that dispatches to the float handler.case "gridstack_float": return this.float(args as FloatParams);
- src/types.ts:225-227 (schema)TypeScript interface defining the input parameters for the gridstack_float tool.export interface FloatParams { val?: boolean; }
- src/utils/gridstack-utils.ts:16-27 (helper)Helper method used by the handler to format and generate the response including code, description, example, and notes for the float operation.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); }