poker_deleteBody
Remove a task body from the task management system with dependency validation to prevent orphaned subtasks or broken workflows.
Instructions
立体を削除します(依存関係チェック付き)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 削除する立体名 |
Implementation Reference
- src/mcp/tools/bodyTools.js:171-184 (schema)Tool schema definition for poker_deleteBody, including input validation for the body name.{ name: 'poker_deleteBody', description: '立体を削除します(依存関係チェック付き)', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '削除する立体名' } }, required: ['name'] } }
- src/mcp/handlers/bodyHandlers.js:81-90 (handler)The main handler function for the poker_deleteBody tool. Validates input, calls taskManager.deleteBody, and returns success or throws error.async deleteBody(args) { try { if (!args.name) throw new ValidationError('立体名は必須です', 'name', args.name); const result = await taskManager.deleteBody(args.name); return { success: true, message: result }; } catch (error) { logger.error('deleteBodyハンドラーエラー', { args, error: error.message }); throw error; } }
- src/services/DataManager.js:382-389 (helper)Core implementation that removes the specified body from the data.body array in memory. This is executed when pending changes are applied.case 'delete_body': if (this.data.body) { const bodyIndex = this.data.body.findIndex(b => b.name === data.name); if (bodyIndex !== -1) { this.data.body.splice(bodyIndex, 1); } } break;
- src/mcp/handlers/index.js:13-16 (registration)Registers the body handlers (including deleteBody) into the handlers object used by the server.export function createAllHandlers(taskManager) { return { // 立体操作 ...createBodyHandlers(taskManager),
- src/mcp/server.js:43-57 (registration)Registers the generic tool call handler on the MCP server, which maps 'poker_deleteBody' to 'deleteBody' handler dynamically.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 })(); });