Skip to main content

Module gotify

Module gotify 

Source
Expand description

Gotify MCP - subscribe to + read from external notifications (mcp__forge__gotify__*).

A forge session subscribes the configured Gotify server; matching notifications deliver into the session as a user-turn, spawning it if asleep. gotify__subscribe / gotify__list / gotify__unsubscribe manage the caller’s OWN subscriptions - a lead the lead’s, a worker its own, neither the other’s; gotify__apps / gotify__recent are read-only server queries (application names, recent-notification catch-up). All are ANY-CALLER - mirroring the cron family, not the lead-only agents verbs, down to the owner scoping on list + remove.

  • facade - the GotifyFacade seam (prod over Weak<Workspace> + a mock for tool tests).

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use forge_sdk::mcp::server::McpServerBuilder; πŸ”’
use forge_sdk::mcp::tool::Tool; πŸ”’
use forge_sdk::mcp::tool::ToolInput; πŸ”’
use forge_sdk::mcp::tool::ToolOutput; πŸ”’
use forge_connectors::gotify::GotifyRecent; πŸ”’
use forge_primitives::GotifySubscription; πŸ”’
use uuid::Uuid; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::mcp::gotify::facade::GotifyFacade; πŸ”’
use crate::mcp::gotify::facade::GotifyReadError; πŸ”’
use crate::mcp::gotify::facade::GotifySubscribeError; πŸ”’
use crate::mcp::gotify::facade::GotifyUnsubscribeError; πŸ”’

ModulesΒ§

facade πŸ”’
GotifyFacade - the seam between the Gotify MCP tools and workspace state. The production impl (ProdGotifyFacade) resolves the caller’s project + durable identity and drives the direct Workspace subscription methods; the mock records calls for tool tests.
types
Wire-shape type for a matched Gotify notification on its way into a subscriber’s chat.

StructsΒ§

Apps πŸ”’
List πŸ”’
Recent πŸ”’
RecentArgs πŸ”’
Subscribe πŸ”’
SubscribeArgs πŸ”’
Unsubscribe πŸ”’
UnsubscribeArgs πŸ”’

ConstantsΒ§

DEFAULT_RECENT_LIMIT πŸ”’
Default notification count for gotify__recent when limit is omitted.

FunctionsΒ§

add_tools πŸ”’
Attach the five Gotify tools to an existing McpServerBuilder. Called for BOTH lead and worker sessions (any-caller), so build_forge_server invokes this unconditionally. apps / recent are server-global reads and don’t take the caller slot.
format_read_error πŸ”’
format_subscribe_error πŸ”’
recent_to_json πŸ”’
sub_to_json πŸ”’
Readable JSON for one subscription (the tool-output shape the LLM sees), shared by the gotify__list rows and the gotify__unsubscribe echo. No team_role: both show only the caller’s own, so the field could carry just one value, and cron_to_json omits it for the same reason.
tool_error πŸ”’