poker_updateZone
Update material properties and density values for specified zones in task management structures to maintain accurate physical modeling parameters.
Instructions
既存ゾーンの材料や密度を更新します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body_name | Yes | 更新するゾーンの立体名 | |
| density | No | 新しい密度 (g/cm³) | |
| material | No | 新しい材料名 |
Implementation Reference
- src/mcp/handlers/zoneHandlers.js:72-119 (handler)MCP tool handler for poker_updateZone: validates arguments (body_name required, density rules for materials), destructures updates, calls taskManager.updateZone, handles specific errors like -32061 with structured response.async updateZone(args) { try { if (!args.body_name) throw new ValidationError('立体名は必須です', 'body_name', args.body_name); // 材料更新時の密度制約チェック if (args.material !== undefined) { // VOID材料での密度指定チェック if (args.material === 'VOID' && args.density !== undefined) { throw new ValidationError( 'Density cannot be specified for VOID material', 'density', args.density ); } // 非VOID材料への変更時の密度必須チェック if (args.material !== 'VOID' && args.density === undefined) { throw new ValidationError( 'Density must be specified for non-VOID materials', 'density', args.density ); } } const { body_name, ...updates } = args; const result = await taskManager.updateZone(body_name, updates); return { success: true, message: result }; } catch (error) { logger.error('updateZoneハンドラーエラー', { args, error: error.message }); // マニフェスト仕様のupdate専用エラーコード処理 if (error.code === -32061) { return { success: false, error: error.message, details: { errorCode: error.code, suggestion: 'proposeZoneメソッドを使用してください', missingObject: args.body_name, objectType: 'ゾーン' } }; } throw error; } },
- src/mcp/tools/zoneTools.js:27-50 (schema)Tool schema definition: name, description, and inputSchema specifying body_name (required string), optional material (string), density (number 0.001-30.0).{ name: 'poker_updateZone', description: '既存ゾーンの材料や密度を更新します', inputSchema: { type: 'object', properties: { body_name: { type: 'string', description: '更新するゾーンの立体名' }, material: { type: 'string', description: '新しい材料名' }, density: { type: 'number', description: '新しい密度 (g/cm³)', minimum: 0.001, maximum: 30.0 } }, required: ['body_name'] } },
- src/mcp/server.js:43-57 (registration)MCP server request handler for tool calls: extracts tool name and args, computes handlerName by removing 'poker_' prefix (maps 'poker_updateZone' to 'updateZone'), retrieves and invokes the handler with safeExecute.this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; logger.info(`MCP Tool実行: ${name}`, { args }); // ハンドラー名をツール名から生成(プレフィックス除去) const handlerName = name.replace('poker_', ''); const handler = this.handlers[handlerName]; if (!handler) { throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`); } return await safeExecute(async () => handler(args), { tool: name })(); });