UNPKG

@withpica/mcp-server

Version:

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

86 lines • 3.71 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: "Mark the user's MCP onboarding as acknowledged. Call this " + "ONLY after walking the user through identity (their role, " + "name to display), security (data handling, retention), and " + "intent (what they want to do with withPICA). Required before " + "other tools work for OAuth-arrived users who skipped the " + "wizard. Pass the user's stated identity in identity_notes " + "and (optionally) their intent in intent_notes.", 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. " + "Required.", }, intent_notes: { type: "string", description: "What the user said when asked what they want to do " + "with withPICA. Free text. Optional.", }, }, required: ["identity_notes"], }, }, executor: this.acknowledge.bind(this), }, ]; } async acknowledge(args) { const identityNotes = args.identity_notes; const intentNotes = args.intent_notes; if (typeof identityNotes !== "string" || identityNotes.trim().length === 0) { return { content: [ { type: "text", text: "Error: identity_notes is required (what the user said about who they are).", }, ], isError: true, }; } const result = await this.pica.onboarding.acknowledge({ identity_notes: identityNotes.trim(), intent_notes: typeof intentNotes === "string" && intentNotes.trim().length > 0 ? intentNotes.trim() : undefined, }); return { content: [ { type: "text", text: "Onboarding acknowledged. You can now use any tool the user " + "asks for; the gate is cleared for this account.", }, ], structuredContent: { kind: "pica.card.onboarding_acknowledged", version: 1, data: { acknowledged_at: result.acknowledged_at, }, }, }; } } //# sourceMappingURL=onboarding.js.map