iCalendar export: domain service + API + MCP tool (#15)

This commit is contained in:
2026-07-12 14:27:20 +02:00
parent affd7f0223
commit b00272aceb
9 changed files with 315 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ use schemars::JsonSchema;
use serde::Deserialize;
use uuid::Uuid;
use crate::tools::{channels, library, schedule};
use crate::tools::{channels, ical, library, schedule};
const SERVER_NAME: &str = "k-tv-mcp";
@@ -201,6 +201,16 @@ impl KTvMcpServer {
)
.await
}
#[tool(
description = "Export a channel's schedule as iCalendar (.ics). Returns RFC 5545 text."
)]
async fn export_schedule_ical(&self, #[tool(aggr)] p: ChannelIdParam) -> String {
match parse_uuid(&p.channel_id) {
Ok(id) => ical::export_schedule_ical(&self.channel_query, id).await,
Err(e) => e,
}
}
}
#[tool(tool_box)]