UNPKG

@withpica/mcp-server

Version:

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

76 lines • 3.43 kB
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved. export class OnboardingTools { pica; constructor(pica) { this.pica = pica; } getTools() { return [ { definition: { name: "pica_acknowledge_onboarding", scope: "always", audiences: ["stdio", "http"], tier: "write", description: "Dismiss the welcome offered to a user who connected through " + "their AI app (a response's _meta.onboarding_offer). Optional: " + "every other tool works without it. If the user has said who " + "they are or what they want to do with withPICA, pass it in " + "identity_notes / intent_notes; both are optional.", 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: { identity_notes: { type: "string", description: "What the user said when asked who they are and what " + "to call them (role, display name, etc.). Free text. " + "Optional.", }, intent_notes: { type: "string", description: "What the user said when asked what they want to do " + "with withPICA. Free text. Optional.", }, }, required: [], }, }, executor: this.acknowledge.bind(this), }, ]; } async acknowledge(args) { const note = (v) => typeof v === "string" && v.trim().length > 0 ? v.trim() : undefined; const identityNotes = note(args.identity_notes); const intentNotes = note(args.intent_notes); const result = await this.pica.onboarding.acknowledge({ ...(identityNotes ? { identity_notes: identityNotes } : {}), ...(intentNotes ? { intent_notes: intentNotes } : {}), }); const notesSaved = result.notes_saved === true; const sentNotes = Boolean(identityNotes || intentNotes); return { content: [ { type: "text", text: "Welcome dismissed; it won't be offered again on this account." + (sentNotes && !notesSaved ? " The notes were not stored: this connection can't save notes." : ""), }, ], structuredContent: { kind: "pica.card.onboarding_acknowledged", version: 1, data: { acknowledged_at: result.acknowledged_at, notes_saved: notesSaved, }, }, }; } } //# sourceMappingURL=onboarding.js.map