Skip to main content
Glama

gridstack_column

Adjust the column count in GridStack layouts to control widget arrangement and responsiveness. Specify a number or 'auto' to optimize dashboard grid structure.

Instructions

Change the number of columns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesNumber of columns or 'auto'
layoutNoHow to re-layout widgetsmoveScale

Implementation Reference

  • The core handler function for the 'gridstack_column' tool. It destructures the input parameters (column count and optional layout strategy), constructs the GridStack 'column' method call as a string, and delegates to GridStackUtils.generateGridStackCode to format the response.
    private async column(params: ColumnParams): Promise<string> {
      const { column, layout = "moveScale" } = params;
    
      return this.utils.generateGridStackCode("column", {
        column,
        layout,
        code: `grid.column(${
          typeof column === "string" ? `'${column}'` : column
        }, '${layout}');`,
      });
    }
  • Tool registration in GridStackTools.listTools(). Defines the tool name, description, and input schema for validating parameters like column count and layout option.
    {
      name: "gridstack_column",
      description: "Change the number of columns",
      inputSchema: {
        type: "object",
        required: ["column"],
        properties: {
          column: {
            oneOf: [{ type: "number" }, { type: "string", enum: ["auto"] }],
            description: "Number of columns or 'auto'",
          },
          layout: {
            type: "string",
            enum: ["moveScale", "move", "scale", "none", "list"],
            description: "How to re-layout widgets",
            default: "moveScale",
          },
        },
      },
    },
  • TypeScript interface defining the input parameters for the gridstack_column tool, used for type safety in the handler.
    export interface ColumnParams {
      column: number | "auto";
      layout?: ColumnOptions;
    }
  • Switch case in GridStackTools.callTool() that routes calls to the specific column handler method.
    case "gridstack_column":
      return this.column(args as ColumnParams);
  • Invocation of the shared helper GridStackUtils.generateGridStackCode specific to column operation, which formats the response with description, example, and notes.
      return this.utils.generateGridStackCode("column", {
        column,
        layout,
        code: `grid.column(${
          typeof column === "string" ? `'${column}'` : column
        }, '${layout}');`,
      });
    }

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