Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

poker_proposeZone

Proposes material zones for 3D bodies with physical validation, specifying material type and density parameters for structural analysis.

Instructions

材料ゾーンを提案します(物理検証付き)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
body_nameYesゾーンが適用される立体名
densityNo密度 (g/cm³)
materialYes材料名(例:CONCRETE, STEEL, VOID)

Implementation Reference

  • The core handler function that implements the logic for poker_proposeZone. It validates the input arguments, enforces material-density rules, delegates to taskManager.proposeZone, and provides custom error responses for specific error codes.
    async proposeZone(args) {
      try {
        validateZoneRequest(args);
        
        // 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 result = await taskManager.proposeZone(args.body_name, args.material, args.density);
        return { success: true, message: result };
      } catch (error) {
        logger.error('proposeZoneハンドラーエラー', { args, error: error.message });
        
        // マニフェスト仕様のpropose専用エラーコード処理
        if (error.code === -32060) {
          return {
            success: false,
            error: error.message,
            details: {
              errorCode: error.code,
              suggestion: 'updateZoneメソッドを使用してください',
              existingObject: args.body_name,
              objectType: 'ゾーン'
            }
          };
        }
        
        // フェーズ1: 保留中の立体エラー処理
        if (error.code === -32090) {
          return {
            success: false,
            error: error.message,
            details: {
              errorCode: error.code,
              suggestion: 'applyChangesを実行して立体を永続化してください',
              pendingBody: args.body_name,
              workflowGuide: [
                '1. すべての立体(body)を定義',
                '2. poker_applyChangesで永続化',
                '3. ゾーン(zone)を定義',
                '4. 最後にpoker_applyChangesで確定'
              ]
            }
          };
        }
        
        throw error;
      }
    },
  • Tool schema definition including name, description, and input schema validation for poker_proposeZone.
    {
      name: 'poker_proposeZone',
      description: '材料ゾーンを提案します(物理検証付き)',
      inputSchema: {
        type: 'object',
        properties: {
          body_name: {
            type: 'string',
            description: 'ゾーンが適用される立体名'
          },
          material: {
            type: 'string',
            description: '材料名(例:CONCRETE, STEEL, VOID)'
          },
          density: {
            type: 'number',
            description: '密度 (g/cm³)',
            minimum: 0.001,
            maximum: 30.0
          }
        },
        required: ['body_name', 'material']
      }
    },
  • Registers the tool list (including poker_proposeZone schema) in response to ListToolsRequestSchema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: allTools };
    });
  • Registers the general tool execution handler, which maps 'poker_proposeZone' to the 'proposeZone' handler by stripping the 'poker_' prefix.
    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 })();
    });
  • Includes zone handlers (containing proposeZone) in the allHandlers object used by the server.
    // ゾーン操作
    ...createZoneHandlers(taskManager),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hirao-Y/poker_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server