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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool saves to JSON but lacks behavioral details: whether it overwrites existing saves, requires specific permissions, has side effects, or returns confirmation. For a write operation with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—'Save grid layout to JSON' is front-loaded and directly conveys the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a write operation (save), the description is incomplete. It doesn't cover behavioral traits, return values, or error handling, making it insufficient for an agent to understand the tool's full context and implications.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema. The description adds no parameter semantics beyond implying JSON output, so it meets the baseline of 3 where the schema handles documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Save grid layout to JSON' clearly states the action (save) and resource (grid layout) with the output format (JSON). It distinguishes from siblings like 'gridstack_load' (loads layout) and 'gridstack_get_grid_items' (retrieves items), but doesn't explicitly contrast with all 25+ siblings, keeping it at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., after modifying layout), exclusions, or compare to similar tools like 'gridstack_batch_update' or 'gridstack_update_widget', leaving the agent with minimal context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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