Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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();`,
      });
    }
  • 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: {},
      },
    },
  • Switch case in callTool() method that dispatches the tool call to the getFloat() handler.
    case "gridstack_get_float":
      return this.getFloat();
  • 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);
    }
  • 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";
    }

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