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
| Name | Required | Description | Default |
|---|---|---|---|
| backup_comment | No | バックアップのコメント | |
| force | No | 強制適用フラグ(警告を無視) |
Implementation Reference
- src/mcp/handlers/index.js:46-49 (handler)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 }; }
- src/mcp/tools/commonTools.js:3-21 (schema)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 } } } }
- src/mcp/server.js:43-57 (registration)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 })(); });
- src/mcp/server.js:38-40 (registration)Registers the MCP listTools request handler to return all available tools including 'poker_applyChanges'.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools }; });
- src/services/DataManager.js:331-356 (helper)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'); } }