build_paraboloid
Generate paraboloid structures like satellite dishes or bowls in Minecraft Bedrock Edition. Define center coordinates, radius, height, material, and optional parameters like axis and direction for precise customization.
Instructions
Build PARABOLOID: satellite dish, bowl, dish, parabolic. Requires: centerX,centerY,centerZ,radius,height. Optional: axis,direction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Build action to perform | build |
| axis | No | Paraboloid axis direction: x (east-west), y (up-down), z (north-south) | y |
| centerX | Yes | Center X coordinate (east-west position of paraboloid base center) | |
| centerY | Yes | Center Y coordinate (height/vertical position of paraboloid base, typically 64-100) | |
| centerZ | Yes | Center Z coordinate (north-south position of paraboloid base center) | |
| direction | No | Opening direction: positive (opens toward +axis), negative (opens toward -axis) | positive |
| height | Yes | Height of the paraboloid in blocks. Small: 5-8, Medium: 10-15, Large: 20-30 | |
| hollow | No | Make it hollow (true) for dish shell, or solid (false) for full paraboloid | |
| material | No | Block type to build with (e.g. stone, glass, wool, concrete, etc.) | minecraft:stone |
| radius | Yes | Maximum radius at the top of the paraboloid in blocks. Small: 3-5, Medium: 8-12, Large: 15-20 |
Implementation Reference
- Core handler function that validates inputs, calculates paraboloid positions using geometry utils, and executes optimized build via build-executor.async execute(args: { action?: string; centerX: number; centerY: number; centerZ: number; radius: number; height: number; material?: string; hollow?: boolean; axis?: 'x' | 'y' | 'z'; direction?: 'positive' | 'negative'; }): Promise<ToolCallResult> { try { // Socket-BE API接続確認 if (!this.world) { return { success: false, message: "World not available. Ensure Minecraft is connected." }; } const { action = 'build', centerX, centerY, centerZ, radius, height, material = 'minecraft:stone', hollow = false, axis = 'y', direction = 'positive' } = args; // actionパラメータをサポート(現在は build のみ) if (action !== 'build') { return this.createErrorResponse(`Unknown action: ${action}. Only 'build' is supported.`); } // 座標の整数化 const center = { x: Math.floor(centerX), y: Math.floor(centerY), z: Math.floor(centerZ) }; // Y座標の検証 if (center.y < -64 || center.y + height > 320) { return { success: false, message: 'Paraboloid extends beyond valid Y coordinates (-64 to 320)' }; } // 半径と高さの検証 if (radius < 2 || radius > 50) { return { success: false, message: 'Radius must be between 2 and 50' }; } if (height < 1 || height > 50) { return { success: false, message: 'Height must be between 1 and 50' }; } // ブロックIDの正規化 let blockId = material; if (!blockId.includes(':')) { blockId = `minecraft:${blockId}`; } const commands: string[] = []; let blocksPlaced = 0; const radiusInt = Math.round(radius); const heightInt = Math.round(height); // 座標変換ヘルパー関数 const transformCoordinates = (localX: number, localY: number, localZ: number): {x: number, y: number, z: number} => { const directionMultiplier = direction === 'positive' ? 1 : -1; switch (axis) { case 'x': // X軸パラボロイド: Y-Z平面で展開、X方向に開く return { x: center.x + localY * directionMultiplier, y: center.y + localZ, z: center.z + localX }; case 'z': // Z軸パラボロイド: X-Y平面で展開、Z方向に開く return { x: center.x + localX, y: center.y + localZ, z: center.z + localY * directionMultiplier }; case 'y': default: // Y軸パラボロイド(デフォルト): X-Z平面で展開、Y方向に開く return { x: center.x + localX, y: center.y + localY * directionMultiplier, z: center.z + localZ }; } }; const radiusSquared = radiusInt * radiusInt; // 放物面の座標を計算 const positions = calculateParaboloidPositions( center, radiusInt, heightInt, direction as 'up' | 'down', hollow ); if (positions.length > BUILD_LIMITS.PARABOLOID) { return { success: false, message: `Too many blocks to place (maximum ${BUILD_LIMITS.PARABOLOID.toLocaleString()})` }; } try { // 最適化されたビルド実行 const result = await executeBuildWithOptimization( this.world, positions, blockId, { type: 'paraboloid', center: center, radius: radiusInt, height: heightInt, material: blockId, hollow: hollow, axis: axis, direction: direction, apiUsed: 'Socket-BE' } ); if (!result.success) { return this.createErrorResponse(result.message); } return { success: true, message: result.message, data: result.data }; } catch (buildError) { return this.createErrorResponse(`Building error: ${buildError instanceof Error ? buildError.message : String(buildError)}`); } } catch (error) { return { success: false, message: `Error building paraboloid: ${error instanceof Error ? error.message : String(error)}` }; } }
- Input schema defining parameters for the build_paraboloid tool, including required center coordinates, radius, height, and optional material, hollow, axis, direction.readonly inputSchema: InputSchema = { type: 'object', properties: { action: { type: 'string', description: 'Build action to perform', enum: ['build'], default: 'build' }, centerX: { type: 'number', description: 'Center X coordinate (east-west position of paraboloid base center)' }, centerY: { type: 'number', description: 'Center Y coordinate (height/vertical position of paraboloid base, typically 64-100)' }, centerZ: { type: 'number', description: 'Center Z coordinate (north-south position of paraboloid base center)' }, radius: { type: 'number', description: 'Maximum radius at the top of the paraboloid in blocks. Small: 3-5, Medium: 8-12, Large: 15-20', minimum: 2, maximum: 50 }, height: { type: 'number', description: 'Height of the paraboloid in blocks. Small: 5-8, Medium: 10-15, Large: 20-30', minimum: 1, maximum: 50 }, material: { type: 'string', description: 'Block type to build with (e.g. stone, glass, wool, concrete, etc.)', default: 'minecraft:stone' }, hollow: { type: 'boolean', description: 'Make it hollow (true) for dish shell, or solid (false) for full paraboloid', default: false }, axis: { type: 'string', description: 'Paraboloid axis direction: x (east-west), y (up-down), z (north-south)', enum: ['x', 'y', 'z'], default: 'y' }, direction: { type: 'string', description: 'Opening direction: positive (opens toward +axis), negative (opens toward -axis)', enum: ['positive', 'negative'], default: 'positive' } }, required: ['centerX', 'centerY', 'centerZ', 'radius', 'height'] };
- src/server.ts:348-372 (registration)Instantiation of BuildParaboloidTool and addition to the tools array in the MCP server's initializeTools method.this.tools = [ // Socket-BE Core API ツール(推奨 - シンプルでAI使いやすい) new AgentTool(), new WorldTool(), new PlayerTool(), new BlocksTool(), new SystemTool(), new CameraTool(), new SequenceTool(), new MinecraftWikiTool(), // Advanced Building ツール(高レベル建築機能) new BuildCubeTool(), // ✅ 完全動作 new BuildLineTool(), // ✅ 完全動作 new BuildSphereTool(), // ✅ 完全動作 new BuildCylinderTool(), // ✅ 修正済み new BuildParaboloidTool(), // ✅ 基本動作 new BuildHyperboloidTool(), // ✅ 基本動作 new BuildRotateTool(), // ✅ 基本動作 new BuildTransformTool(), // ✅ 基本動作 new BuildTorusTool(), // ✅ 修正完了 new BuildHelixTool(), // ✅ 修正完了 new BuildEllipsoidTool(), // ✅ 修正完了 new BuildBezierTool(), // ✅ 新規追加(可変制御点ベジェ曲線) ];
- src/server.ts:494-573 (registration)Loop that registers all tools (including build_paraboloid) to the MCP server using mcpServer.registerTool, converting schema to Zod and wrapping the tool's execute method.this.tools.forEach((tool) => { // inputSchemaをZod形式に変換(SchemaToZodConverterを使用) const zodSchema = schemaConverter.convert(tool.inputSchema); // ツールを登録 this.mcpServer.registerTool( tool.name, { title: tool.name, description: tool.description, inputSchema: zodSchema, }, async (args: any) => { try { const result = await tool.execute(args); let responseText: string; if (result.success) { // 建築ツールの場合は最適化 if (tool.name.startsWith('build_')) { const optimized = optimizeBuildResult(result); responseText = `✅ ${optimized.message}`; if (optimized.summary) { responseText += `\n\n📊 Summary:\n${JSON.stringify(optimized.summary, null, 2)}`; } } else { // 通常ツールの場合 responseText = result.message || `Tool ${tool.name} executed successfully`; if (result.data) { // データサイズチェック const dataStr = JSON.stringify(result.data, null, 2); const sizeWarning = checkResponseSize(dataStr); if (sizeWarning) { // 大きすぎる場合はデータタイプのみ表示 responseText += `\n\n${sizeWarning}`; responseText += `\nData type: ${Array.isArray(result.data) ? `Array[${result.data.length}]` : typeof result.data}`; } else { responseText += `\n\nData: ${dataStr}`; } } } } else { // エラーメッセージにヒントを追加 const errorMsg = result.message || "Tool execution failed"; const enrichedError = enrichErrorWithHints(errorMsg); responseText = `❌ ${enrichedError}`; if (result.data) { responseText += `\n\nDetails:\n${JSON.stringify(result.data, null, 2)}`; } } return { content: [ { type: "text", text: responseText, }, ], }; } catch (error) { const errorMsg = error instanceof Error ? error.message : String(error); const errorStack = error instanceof Error ? error.stack : undefined; const exceptionMessage = `Tool execution failed with exception: ${errorMsg}${errorStack ? `\n\nStack trace:\n${errorStack}` : ""}`; return { content: [ { type: "text", text: `❌ ${exceptionMessage}`, }, ], }; } } ); });