Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

poker_analyzeUnitConversion

Calculate conversion factors between different unit systems and analyze physical consistency for length, angle, density, and radioactivity measurements.

Instructions

異なる単位系間の変換係数を分析・計算します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includePhysicalAnalysisNo物理的整合性分析を含めるか
targetUnitsYes変換先単位系(4キー必須)

Implementation Reference

  • Handler function that validates input, calls taskManager.analyzeUnitConversion, logs, and returns formatted result for the poker_analyzeUnitConversion tool.
    async analyzeUnitConversion(args) {
      try {
        const { targetUnits, includePhysicalAnalysis = true } = args;
        
        if (!targetUnits) {
          throw new ValidationError('変換先単位系(targetUnits)は必須です', 'targetUnits', targetUnits);
        }
        
        logger.info('単位変換分析開始', { targetUnits, includePhysicalAnalysis });
        
        // TaskManagerの変換係数分析機能を利用
        const result = await taskManager.analyzeUnitConversion(targetUnits, includePhysicalAnalysis);
        
        logger.info('単位変換分析完了', { 
          isIdentityConversion: result.conversion.isIdentity,
          recommendationCount: result.recommendations.length
        });
        
        return {
          success: true,
          message: `単位変換分析完了 - ${result.conversion.isIdentity ? '変換不要' : '変換が必要'}`,
          conversion: result
        };
        
      } catch (error) {
        logger.error('単位変換分析エラー', { args, error: error.message });
        throw error;
      }
    },
  • Tool schema definition including inputSchema, description, and name for poker_analyzeUnitConversion.
    {
      name: 'poker_analyzeUnitConversion',
      description: '異なる単位系間の変換係数を分析・計算します',
      inputSchema: {
        type: 'object',
        properties: {
          targetUnits: {
            type: 'object',
            properties: {
              length: { type: 'string', enum: ['m', 'cm', 'mm'] },
              angle: { type: 'string', enum: ['radian', 'degree'] },
              density: { type: 'string', enum: ['g/cm3'] },
              radioactivity: { type: 'string', enum: ['Bq'] }
            },
            required: ['length', 'angle', 'density', 'radioactivity'],
            additionalProperties: false,
            description: '変換先単位系(4キー必須)'
          },
          includePhysicalAnalysis: {
            type: 'boolean',
            description: '物理的整合性分析を含めるか',
            default: true
          }
        },
        required: ['targetUnits'],
        additionalProperties: false,
        title: '単位変換分析',
        description: '現在の単位系から指定単位系への変換係数計算と物理的整合性分析'
      }
    }
  • Dynamic registration of all tools via setRequestHandler for CallToolRequestSchema, mapping 'poker_*' tool names to corresponding handler functions by stripping '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 })();
    });

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