gridstack_float
Enable or disable floating widgets in GridStack.js dashboards to control widget positioning and overlay behavior.
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 primary handler function that implements the gridstack_float tool logic. It destructures the input parameter 'val' (boolean) and generates JavaScript code to call GridStack's grid.float() method, optionally with the value, using the GridStackUtils helper.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 (registration)Tool registration in listTools() method, defining the name, description, and input schema for validation.{ name: "gridstack_float", description: "Enable or disable floating widgets", inputSchema: { type: "object", properties: { val: { type: "boolean", description: "Enable floating (true) or disable (false)", }, }, }, },
- src/types.ts:225-227 (schema)TypeScript interface defining the input parameters for the gridstack_float tool.export interface FloatParams { val?: boolean; }
- src/tools/index.ts:789-790 (registration)Dispatch registration in the callTool switch statement, routing calls to the float handler method.case "gridstack_float": return this.float(args as FloatParams);
- src/utils/gridstack-utils.ts:16-27 (helper)Supporting utility method used by the handler to format the response with operation-specific descriptions, examples, 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); }