mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-16 09:42:29 -04:00
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: rosslh <ross@rosshill.ca>
45 lines
1.9 KiB
PHP
45 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Mcp\Tools;
|
|
|
|
use Laravel\Mcp\Server\Tools\Annotations\IsDestructive;
|
|
use Laravel\Mcp\Server\Tools\Annotations\IsIdempotent;
|
|
use Laravel\Mcp\Server\Tools\Annotations\IsReadOnly;
|
|
|
|
#[IsReadOnly(false)]
|
|
#[IsDestructive]
|
|
#[IsIdempotent]
|
|
class ManageNotifications extends RestActionTool
|
|
{
|
|
protected string $name = 'manage_notifications';
|
|
|
|
protected string $description = 'Read or change the notification settings of the authenticated team per channel (resource: email, discord, slack, telegram, pushover, webhook). Webhook URLs, tokens, and passwords are never returned. Requires read ability for get, write ability for update. Same validation and permissions as the REST API.';
|
|
|
|
private const CHANNEL_PATHS = [
|
|
'email' => 'notifications/email',
|
|
'discord' => 'notifications/discord',
|
|
'slack' => 'notifications/slack',
|
|
'telegram' => 'notifications/telegram',
|
|
'pushover' => 'notifications/pushover',
|
|
'webhook' => 'notifications/webhook',
|
|
];
|
|
|
|
protected function actions(): array
|
|
{
|
|
return [
|
|
'get' => ['method' => 'GET', 'paths' => self::CHANNEL_PATHS, 'ability' => 'read', 'description' => 'settings of one channel'],
|
|
'update' => ['method' => 'PATCH', 'paths' => self::CHANNEL_PATHS, 'ability' => 'write', 'description' => 'change settings of one channel (data: fields of that channel, for example discord_enabled, discord_webhook_url, deployment_failure_discord_notifications)'],
|
|
];
|
|
}
|
|
|
|
protected function pathParams(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected function dataDescription(): string
|
|
{
|
|
return 'Request body, same fields as the REST API for the channel (for example smtp_*, resend_*, *_enabled, *_webhook_url, telegram_token, telegram_chat_id, pushover_user_key, pushover_api_token, and the per-event *_notifications flags).';
|
|
}
|
|
}
|