Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

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
NameRequiredDescriptionDefault
body_nameYes更新するゾーンの立体名
densityNo新しい密度 (g/cm³)
materialNo新しい材料名

Implementation Reference

  • 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;
      }
    },
  • 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']
      }
    },
  • 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 })();
    });

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