gridstack_get_margin
Retrieve current margin values from GridStack.js layouts to maintain consistent spacing between grid elements and ensure proper widget alignment in dashboard designs.
Instructions
Get current margin values
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:1139-1143 (handler)The handler function for the 'gridstack_get_margin' tool. It generates a standardized code snippet and documentation using GridStackUtils to execute `grid.getMargin()` and retrieve the current grid margin values.private async getMargin(): Promise<string> { return this.utils.generateGridStackCode("getMargin", { code: `const margin = grid.getMargin();`, }); }
- src/tools/index.ts:706-713 (schema)Input schema definition for the tool in listTools(). The tool requires no input parameters.{ name: "gridstack_get_margin", description: "Get current margin values", inputSchema: { type: "object", properties: {}, }, },
- src/tools/index.ts:846-847 (registration)Registration of the tool in the callTool switch dispatcher, routing calls to the getMargin handler method.case "gridstack_get_margin": return this.getMargin();