Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

poker_applyChanges

Apply pending changes to YAML task files with automatic backup creation, enabling task management updates while preserving previous versions.

Instructions

保留中の全変更を実際のYAMLファイルに適用します(自動バックアップ実行)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backup_commentNoバックアップのコメント
forceNo強制適用フラグ(警告を無視)

Implementation Reference

  • MCP tool handler function 'applyChanges' (mapped from 'poker_applyChanges'). Delegates execution to TaskManager.applyChanges() and formats the response.
    async applyChanges(args) {
      const result = await taskManager.applyChanges();
      return { success: true, message: '変更を適用しました', details: result };
    }
  • Tool schema definition for 'poker_applyChanges' with input parameters for force override and backup comment.
    {
      name: 'poker_applyChanges',
      description: '保留中の全変更を実際のYAMLファイルに適用します(自動バックアップ実行)',
      inputSchema: {
        type: 'object',
        properties: {
          force: {
            type: 'boolean',
            description: '強制適用フラグ(警告を無視)',
            default: false
          },
          backup_comment: {
            type: 'string',
            description: 'バックアップのコメント',
            maxLength: 200
          }
        }
      }
    }
  • Registers the MCP callTool request handler. Maps tool names by removing 'poker_' prefix to find and execute the corresponding handler function.
    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 MCP listTools request handler to return all available tools including 'poker_applyChanges'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: allTools };
    });
  • Core implementation of applyChanges: iterates over pending changes, applies each via applyChange, creates backup, saves YAML, clears pending changes.
    async applyChanges() {
      if (this.pendingChanges.length === 0) {
        return '適用する変更がありません';
      }
    
      try {
        logger.info('変更の適用を開始します', { count: this.pendingChanges.length });
        
        for (const change of this.pendingChanges) {
          await this.applyChange(change);
        }
    
        await this.saveData();
        
        // 適用後は保留変更をクリア
        this.pendingChanges = [];
        await this.savePendingChanges();
    
        logger.info('すべての変更を適用しました');
        return '変更を正常に適用しました';
        
      } catch (error) {
        logger.error('変更の適用に失敗しました', { error: error.message });
        throw new DataError(`変更の適用に失敗: ${error.message}`, 'APPLY_CHANGES');
      }
    }

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