Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

poker_updateUnit

Updates measurement units for task management, allowing modification of length, angle, density, and radioactivity units while maintaining complete unit structure integrity.

Instructions

既存単位設定を更新します(部分更新可能だが4つのキーは常に維持)- 完全性保証

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
angleNo新しい角度の単位
densityNo新しい密度の単位
lengthNo新しい長さの単位
radioactivityNo新しい放射能の単位

Implementation Reference

  • The main handler function for the 'poker_updateUnit' tool. Validates arguments, invokes taskManager.updateUnit(args), handles specific errors, and returns formatted success/error response.
    async updateUnit(args) {
      try {
        if (!args || Object.keys(args).length === 0) {
          throw new ValidationError('更新する内容が指定されていません', 'updates', args);
        }
        
        logger.info('4キー保持単位更新開始', { updates: args });
        
        // TaskManagerの4キー保持更新機能を利用
        const result = await taskManager.updateUnit(args);
        
        logger.info('4キー保持単位更新完了', { 
          updates: args
        });
        
        return { 
          success: true, 
          message: result,
          updated: {
            ...args,
            integrity: '4-key-preserved'
          }
        };
        
      } catch (error) {
        logger.error('単位設定更新エラー', { args, error: error.message });
        
        // マニフェスト仕様のupdate専用エラーコード処理
        if (error.code === -32087) {
          return {
            success: false,
            error: error.message,
            details: {
              errorCode: error.code,
              suggestion: 'proposeUnitメソッドを使用してください',
              missingObject: 'unit',
              objectType: '単位設定'
            }
          };
        }
        
        throw error;
      }
    },
  • Tool definition including name, description, and input schema for 'poker_updateUnit'. Specifies partial updates for unit settings with validation rules.
    {
      name: 'poker_updateUnit',
      description: '既存単位設定を更新します(部分更新可能だが4つのキーは常に維持)- 完全性保証',
      inputSchema: {
        type: 'object',
        properties: {
          length: {
            type: 'string',
            enum: ['m', 'cm', 'mm'],
            description: '新しい長さの単位'
          },
          angle: {
            type: 'string',
            enum: ['radian', 'degree'],
            description: '新しい角度の単位'
          },
          density: {
            type: 'string',
            enum: ['g/cm3'],
            description: '新しい密度の単位'
          },
          radioactivity: {
            type: 'string',
            enum: ['Bq'],
            description: '新しい放射能の単位'
          }
        },
        minProperties: 1,
        additionalProperties: false,
        title: '4キー保持更新',
        description: '部分更新可能ですが、結果として4キー構造は常に保持されます。'
      }
  • Spreads the unit handlers (including updateUnit) from createUnitHandlers into the combined handlers object used by the MCP server.
    // 単位操作
    ...createUnitHandlers(taskManager),
    
    // 計算操作
  • Registers the general tool call handler which dynamically maps 'poker_updateUnit' to 'updateUnit' handler and executes it.
    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 })();
    });
  • Registers the listTools handler that returns all tool definitions including 'poker_updateUnit'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: allTools };
    });

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