bulc_get_spatial_context
Retrieve the current spatial layout including rooms, walls, levels, and coordinates to place building elements relative to existing objects in BULC Building Designer projects.
Instructions
Get the current spatial layout of the project including all rooms, walls, levels, and their exact coordinates. IMPORTANT: Call this first when you need to place elements relative to existing objects (e.g., 'next to the living room', 'above the kitchen'). Returns bounds, room positions, wall positions, and level information. Use this to calculate coordinates before calling create functions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | Filter by floor level index. 0 = ground floor. Omit to get all levels. |
Implementation Reference
- src/tools/context.ts:175-182 (handler)Handler case in handleContextTool function that validates input arguments using GetSpatialContextSchema and sends the 'get_spatial_context' command to the BULC client.case "bulc_get_spatial_context": { const validated = GetSpatialContextSchema.parse(args); result = await client.sendCommand({ action: "get_spatial_context", params: validated, }); break; }
- src/tools/context.ts:146-148 (schema)Zod schema for input validation: optional 'level' parameter as integer.const GetSpatialContextSchema = z.object({ level: z.number().int().optional(), });
- src/tools/context.ts:9-29 (registration)Tool definition object including name, description, input schema, and annotations, exported as part of contextTools array.{ name: "bulc_get_spatial_context", description: "Get the current spatial layout of the project including all rooms, walls, levels, and their exact coordinates. " + "IMPORTANT: Call this first when you need to place elements relative to existing objects (e.g., 'next to the living room', 'above the kitchen'). " + "Returns bounds, room positions, wall positions, and level information. " + "Use this to calculate coordinates before calling create functions.", inputSchema: { type: "object" as const, properties: { level: { type: "integer", description: "Filter by floor level index. 0 = ground floor. Omit to get all levels.", }, }, }, annotations: { readOnlyHint: true, destructiveHint: false, }, },
- src/index.ts:151-162 (registration)Routing logic in main server CallToolRequest handler that directs 'bulc_get_spatial_context' calls to the handleContextTool function.if ( name === "bulc_get_spatial_context" || name === "bulc_get_home_info" || name === "bulc_list_levels" || name === "bulc_create_level" || name === "bulc_set_current_level" || name === "bulc_undo" || name === "bulc_redo" || name === "bulc_save" ) { return await handleContextTool(name, safeArgs); }
- src/index.ts:40-41 (registration)Inclusion of contextTools (containing bulc_get_spatial_context) into the complete allTools list provided to the MCP server's ListToolsRequest.const allTools = [ ...contextTools, // 8 tools: spatial context, home info, levels, undo/redo, save