Skip to main content
Glama

gridstack_margin

Adjust spacing between grid items in dashboard layouts by setting margin or gap values with CSS units like px, em, or rem.

Instructions

Update grid margin/gap

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesMargin value (px or CSS format)
unitNoCSS unit (px, em, rem, etc.)px

Implementation Reference

  • The handler function that implements the core logic for the gridstack_margin tool. It extracts the value and optional unit from parameters and generates the GridStack code using GridStackUtils to call grid.margin().
    private async margin(params: MarginParams): Promise<string> {
      const { value, unit = "px" } = params;
    
      return this.utils.generateGridStackCode("margin", {
        value,
        unit,
        code: `grid.margin(${typeof value === "string" ? `'${value}'` : value});`,
      });
    }
  • The input schema and tool metadata (name, description) for gridstack_margin, defining the expected parameters.
    {
      name: "gridstack_margin",
      description: "Update grid margin/gap",
      inputSchema: {
        type: "object",
        required: ["value"],
        properties: {
          value: {
            oneOf: [{ type: "number" }, { type: "string" }],
            description: "Margin value (px or CSS format)",
          },
          unit: {
            type: "string",
            description: "CSS unit (px, em, rem, etc.)",
            default: "px",
          },
        },
      },
    },
  • Registration of the handler in the central callTool switch statement, dispatching calls to the margin method.
    case "gridstack_margin":
      return this.margin(args as MarginParams);
  • TypeScript type definition for MarginParams used in the handler signature and casting.
    export interface MarginParams {
      value: number | string;
      unit?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Update' which implies a mutation, but doesn't specify if this affects existing widgets, requires specific permissions, or has side effects like layout reflow. Minimal context is added beyond the basic action.

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 extremely concise with just three words, front-loading the key action ('Update grid margin/gap'). There is zero waste, and every word earns its place by directly conveying the tool's function 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 the complexity of a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'margin/gap' means in the grid context, how the update behaves (e.g., immediate effect, validation), or what happens on success/failure. More detail is needed for safe and effective use.

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%, so the schema fully documents the parameters ('value' and 'unit'). The description adds no additional meaning beyond implying the parameters relate to margin/gap settings, which is already clear from the schema. This meets the baseline for high schema coverage.

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 clearly states the verb ('Update') and resource ('grid margin/gap'), making the purpose understandable. It distinguishes this as a configuration tool for grid spacing, though it doesn't explicitly differentiate from siblings like 'gridstack_cell_height' or 'gridstack_column' which also adjust grid layout properties.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't clarify if this should be used during grid initialization (vs. 'gridstack_init') or for dynamic adjustments, nor does it mention prerequisites like requiring an existing grid. The context is implied but not stated.

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