UNPKG

@withpica/mcp-server

Version:

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

94 lines • 4.25 kB
/** * Enrichment Tools - MCP tools for triggering and checking enrichment */ import { PicaClient } from "@withpica/mcp-sdk"; import { ToolDefinition, ToolExecutor } from "./index.js"; export declare class EnrichmentTools { private pica; constructor(pica: PicaClient); getTools(): Array<{ definition: ToolDefinition; executor: ToolExecutor; }>; private enrichmentCandidates; /** * ADR-179 `pica_resolve_work` executor — fan a work out across * eligible enrichment sources and return the structured receipt. * * `isError` is set only when every source that ran errored. Empty * applied[] + empty proposals[] + empty errors[] is a valid result * (e.g. work has no trigger identifiers) and surfaces as a * non-error response with a human-readable note. */ private resolveWork; /** * ADR-179 Phase 3 `pica_resolve_recording` executor — fan a recording * out across eligible platform sources and return the structured * receipt. Same isError semantics as resolveWork / resolvePerson. */ private resolveRecording; /** * `pica_resolve_release` executor — fan a release out against Spotify * and return the structured receipt. Same isError semantics as * resolveWork / resolveRecording. */ private resolveRelease; /** * ADR-179 Phase 2 `pica_resolve_person` executor — fan a person out * across eligible identity-graph sources and return the structured * receipt. Mirrors `resolveWork`'s isError semantics: partial failure * is a non-error; isError only flips when every source that actually * ran errored. */ private resolvePerson; private runWorkCascade; private runPersonCascade; private cascadeHealth; private listEnrichmentProposals; private applyEnrichmentProposal; private rejectEnrichmentProposal; private bulkRejectEnrichmentProposals; /** * pica_enrichment_proposals_bulk_apply — the accept side of the * /inspect/found queue, in one call. * * ⚠️ The summary names the FAILURES as well as the successes, deliberately. * Applying loops per id across four different update/create paths, so * partial success is the normal outcome, and a summary reading only * "applied N" would let an agent report a clean success while proposals the * user expected to land silently did not. On 2026-08-14 one org applied 53 * proposals one at a time and 8 of them declined as duplicates — under a * bulk call with a success-only summary, that user would have been told 53 * were applied. */ private bulkApplyEnrichmentProposals; /** * ADR-178: pica_enrichment_propose. * * Delegates to PicaClient.enrichment.proposeAgentResearch(). Errors * surface from the SDK as `ApiError` with the raw JSON response in * the message. We extract the service-layer error code (MISSING_SOURCE, * DUPLICATE_SUPPRESSED, etc.) from the parsed body and surface it * in structuredContent so the agent can reason about the failure * without parsing free-text. */ private proposeAgentResearch; /** * pica_enrichment_clear executor. Mirrors the retired bespoke assistant's * handleClearMusicBrainzEnrichmentConfirmed field-by-field: reads the * work's enrichment_metadata to check each field's actual source before * clearing it (a manually-entered or non-MusicBrainz-sourced value is * never touched), then writes only the cleared keys through the same * pica_works_update backing route (PATCH /admin/works/:id) — no * dedicated route, no external API call. * * Deliberate deviation from the bespoke original (whole-branch review, * ADR-277 provenance is load-bearing): on a partial PRO clear, the bespoke * handler nulled the ENTIRE enrichment_metadata.pro_ids block, wiping the * surviving orgs' individual_sources provenance even though their actual * pro_ids values were correctly kept. This version writes the surviving * orgs' individual_sources back so their provenance is never lost. */ private clearEnrichment; } //# sourceMappingURL=enrichment.d.ts.map