gridstack_get_column
Retrieve the current column count in a GridStack layout to monitor grid structure and ensure responsive design alignment.
Instructions
Get current number of columns
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gridstack_get_column"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:1145-1149 (handler)The handler function for 'gridstack_get_column' that generates JavaScript code to retrieve the current number of columns from the GridStack grid instance using grid.column().
private async getColumn(): Promise<string> { return this.utils.generateGridStackCode("getColumn", { code: `const columns = grid.column();`, }); } - src/tools/index.ts:849-850 (registration)Registration of the tool in the callTool switch statement, routing calls to the getColumn handler method.
case "gridstack_get_column": return this.getColumn(); - src/tools/index.ts:715-722 (registration)Tool registration in listTools(), defining the name, description, and input schema (empty object) for the gridstack_get_column tool.
{ name: "gridstack_get_column", description: "Get current number of columns", inputSchema: { type: "object", properties: {}, }, }, - src/tools/index.ts:718-721 (schema)Input schema definition for the tool, specifying an empty object (no parameters required).
inputSchema: { type: "object", properties: {}, },