UNPKG

@withpica/mcp-server

Version:

MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog

73 lines • 3.3 kB
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved. import { formatStructuredList } from "@withpica/mcp-utils"; export class CalendarTools { pica; constructor(pica) { this.pica = pica; } getTools() { return [ { definition: { name: "pica_calendar_events", scope: "read:analytics", audiences: ["stdio", "http", "public"], tier: "read", description: "Get upcoming calendar events — sessions, agreement deadlines, release dates, " + "invoice due dates, and Google Calendar events. Defaults to the next 30 days.", workflows: "infrastructure", vernacular_kind: "specialist", vernacular_reason: "Specialist context; not yet covered by the Creator Question Atlas — pending telemetry-driven addition per ADR-226 Phase 4 substrate writes.", inputSchema: { type: "object", properties: { start_date: { type: "string", description: "Start date (YYYY-MM-DD). Defaults to today.", }, end_date: { type: "string", description: "End date (YYYY-MM-DD). Defaults to 30 days from start.", }, types: { type: "array", items: { type: "string" }, description: "Filter by event type: session, invoice_due, invoice_sent, " + "payment_received, agreement_expiry, agreement_signing, " + "work_release, google_calendar", }, work_id: { type: "string", description: "Filter events linked to a specific work", }, search: { type: "string", description: "Search events by title", }, }, }, }, executor: this.getEvents.bind(this), }, ]; } async getEvents(args) { const today = new Date().toISOString().split("T")[0]; const thirtyDays = new Date(Date.now() + 30 * 86400000) .toISOString() .split("T")[0]; const result = await this.pica.calendar.getEvents({ startDate: args.start_date || today, endDate: args.end_date || thirtyDays, types: args.types, workId: args.work_id, search: args.search, }); const events = Array.isArray(result) ? result : result?.events || []; return formatStructuredList(events, "event", { startDate: args.start_date || today, endDate: args.end_date || thirtyDays, }); } } //# sourceMappingURL=calendar.js.map