feat : update MCP tools with calendar fields and add recurrence tools
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Mcp\Tool\Task;
|
||||
|
||||
use App\Repository\TaskRepository;
|
||||
use App\Service\CalDavService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use Mcp\Capability\Attribute\McpTool;
|
||||
@@ -20,6 +21,7 @@ class DeleteTaskTool
|
||||
private readonly TaskRepository $taskRepository,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly Security $security,
|
||||
private readonly CalDavService $calDavService,
|
||||
) {}
|
||||
|
||||
public function __invoke(int $id): string
|
||||
@@ -35,9 +37,18 @@ class DeleteTaskTool
|
||||
}
|
||||
|
||||
$taskCode = $task->getProject()->getCode().'-'.$task->getNumber();
|
||||
$eventUid = $task->getCalendarEventUid();
|
||||
$todoUid = $task->getCalendarTodoUid();
|
||||
$this->entityManager->remove($task);
|
||||
$this->entityManager->flush();
|
||||
|
||||
if (null !== $eventUid) {
|
||||
$this->calDavService->deleteEvent($eventUid);
|
||||
}
|
||||
if (null !== $todoUid) {
|
||||
$this->calDavService->deleteTodo($todoUid);
|
||||
}
|
||||
|
||||
return json_encode([
|
||||
'success' => true,
|
||||
'message' => sprintf('Task %s deleted.', $taskCode),
|
||||
|
||||
Reference in New Issue
Block a user