gridstack_margin
Adjust grid spacing and gaps between widgets in dashboard layouts using CSS units like px, em, or rem to control visual separation and alignment.
Instructions
Update grid margin/gap
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | Margin value (px or CSS format) | |
| unit | No | CSS unit (px, em, rem, etc.) | px |
Implementation Reference
- src/tools/index.ts:982-990 (handler)The main handler function that executes the gridstack_margin tool logic. It destructures the input parameters and calls the utility method to generate the GridStack 'margin' method call code.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});`, }); }
- src/tools/index.ts:358-376 (schema)The input schema definition for the gridstack_margin tool, specifying required 'value' parameter (number or string) and optional 'unit'.{ 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", }, }, }, },
- src/tools/index.ts:798-799 (registration)The switch case in callTool method that registers and routes execution to the margin handler function.case "gridstack_margin": return this.margin(args as MarginParams);