Skip to main content
Glama

gridstack_save

Save dashboard layouts to JSON format for persistence and reuse, with options to include widget content and grid configuration settings.

Instructions

Save grid layout to JSON

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
saveContentNoInclude widget content in save
saveGridOptNoInclude grid options in save

Implementation Reference

  • The main handler function for the 'gridstack_save' tool. It destructures parameters and generates JavaScript code using GridStackUtils to save the current grid layout to JSON, with options to include content and grid options.
    private async save(params: SaveGridParams): Promise<string> { const { saveContent = true, saveGridOpt = false } = params; return this.utils.generateGridStackCode("save", { saveContent, saveGridOpt, code: `const layout = grid.save(${saveContent}, ${saveGridOpt});`, }); }
  • The tool definition object in listTools(), providing the name, description, and inputSchema (JSON schema for validation) for the 'gridstack_save' MCP tool.
    { name: "gridstack_save", description: "Save grid layout to JSON", inputSchema: { type: "object", properties: { saveContent: { type: "boolean", description: "Include widget content in save", default: true, }, saveGridOpt: { type: "boolean", description: "Include grid options in save", default: false, }, }, }, },
  • The switch case in callTool() method that registers and routes calls to the specific handler for 'gridstack_save'.
    case "gridstack_save": return this.save(args as SaveGridParams);

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