Skip to main content
Glama

gridstack_compact

Optimize dashboard layouts by compacting grid widgets to reduce empty space and improve visual organization. Choose from multiple compaction methods including move, scale, or combined approaches to create efficient widget arrangements.

Instructions

Compact the grid layout

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layoutNoCompact layout typemoveScale
doSortNoSort widgets before compacting

Implementation Reference

  • The primary handler function implementing the gridstack_compact tool. It processes input parameters and generates executable JavaScript code to invoke GridStack's compact method.
    private async compact(params: CompactParams): Promise<string> { const { layout = "moveScale", doSort = true } = params; return this.utils.generateGridStackCode("compact", { layout, doSort, code: `grid.compact('${layout}', ${doSort});`, }); }
  • Tool registration object returned by listTools(), defining the name, description, and input schema for gridstack_compact.
    { name: "gridstack_compact", description: "Compact the grid layout", inputSchema: { type: "object", properties: { layout: { type: "string", enum: ["moveScale", "move", "scale", "none", "list"], description: "Compact layout type", default: "moveScale", }, doSort: { type: "boolean", description: "Sort widgets before compacting", default: true, }, }, }, },
  • Dispatch logic in the callTool method's switch statement that routes calls to the specific compact handler.
    case "gridstack_compact": return this.compact(args as CompactParams);
  • TypeScript interface defining the input parameters for the gridstack_compact handler.
    export interface CompactParams { layout?: ColumnOptions; doSort?: boolean; }

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