gridstack_save
Save dashboard grid layouts to JSON format with options to include widget content and grid configuration settings for persistence and restoration.
Instructions
Save grid layout to JSON
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| saveContent | No | Include widget content in save | |
| saveGridOpt | No | Include grid options in save |
Implementation Reference
- src/tools/index.ts:1001-1009 (handler)The core handler method that generates JavaScript code calling grid.save() to serialize the GridStack layout to JSON, using the provided saveContent and saveGridOpt parameters.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});`, }); }
- src/tools/index.ts:396-413 (registration)Tool registration object defining the name, description, and input schema for the gridstack_save tool, returned by the listTools() method.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, }, }, }, },
- src/types.ts:206-209 (schema)TypeScript interface defining the input parameters (saveContent and saveGridOpt) used by the gridstack_save handler.export interface SaveGridParams { saveContent?: boolean; saveGridOpt?: boolean; }