@withpica/mcp-server
Version:
MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog
101 lines • 4.76 kB
TypeScript
import { PicaClient } from "@withpica/mcp-sdk";
import { ToolDefinition, ToolExecutor } from "./index.js";
/**
* A held ask email (send_status "held"). sendAskEmail
* (lib/services/confirm-ask.ts) passes no initiatedBy, so it sends as
* "system", and decideHold (lib/email/approval-policy.ts) holds a system
* confirm_ask send only under new_template: PICA's team checking a new kind
* of email's first sends. The user has nothing to approve.
*/
export declare const HELD_FOR_CHECK_TAIL = "There's nothing for the user to do. This isn't a user approval, so don't call pica_approval_status for it.";
export declare const HELD_FOR_CHECK: string;
/**
* Is this incoming credit new or different from what the song held: no row
* for the person in that role, or a different share. A share is compared to
* two decimals; unknown (null) only matches unknown.
*/
export declare function creditChanged(before: ReadonlyArray<{
person_id: string;
role: string;
split_percentage: number | null;
}>, c: {
person_id?: string;
role?: string;
splits?: number | null;
}): boolean;
export declare class CreditsTools {
private pica;
constructor(pica: PicaClient);
getTools(): Array<{
definition: ToolDefinition;
executor: ToolExecutor;
}>;
private sendForAttestation;
private askToConfirm;
private listCredits;
private updateCredits;
/**
* ADR-213 Primitive B — pica_recording_credits_update
*
* Writes a single first-party recording credit to the recording_credits
* table via POST /admin/recordings/{recording_id}/credits.
*
* Validates role against RECORDING_CREDIT_ROLES (16 entries) before the
* round trip so we get a structured error rather than a generic 400 from
* the route. credited_name is required (NOT NULL on the table); the route
* also validates this but we surface it earlier.
*
* On success, includes a notification to the credited person if person_id
* is set, mirroring the work-side updateCredits notification flow.
*/
private updateRecordingCredits;
/**
* ADR-264 WS4 prerequisite — the bulk path of pica_recording_credits_update
* (reached when args.credits is an array). It was also the executor of the
* standalone pica_recording_credits_bulk_update tool until mcp-server 2.99.0
* removed that name.
*
* Thin wrapper over POST /admin/recording-credits/bulk via
* RecordingCreditsResource.bulkUpdate. The route + service own validation
* (role enum, org scoping of release/recordings/people, caps, in-batch
* dedup) and return per-row created / skipped_existing results; the
* executor only pre-checks the target shape so agents get a crisp message
* without a round-trip.
*/
private bulkUpdateRecordingCredits;
/**
* ADR-232 — pica_credit_add executor.
*
* Discriminates by entity_type. Works route through CreditsResource.atomicAdd
* (POST /admin/works/[id]/credits/atomic-add → service-layer createWorkCredit
* which classifies role → work_collaborators (composition) or recording_credits
* (master) / recording_splits (owner)). Recordings
* route through RecordingCreditsResource.atomicAdd (POST /admin/recordings/[id]/credits).
* Both return AtomicCreditResult with credit_id.
*/
/**
* pica_credit_update — in-place edit of one credit (2026-09-11).
*
* Closes two ops issues with one verb. `pica_credits_update` is replace-all,
* so an agent changing one writer's share had to re-list every work and
* re-send the whole array — nine reads plus nine writes for one split, with
* a publisher row one forgotten re-list from being dropped (bff0af25). And nothing
* edited a recording credit BY ITS ID — beyond the natural-key upsert a
* change meant remove-then-re-add, losing id and attestation (17f27449). Agents ALREADY reach for this name:
* `pica_credit_update` was the TOOL_NOT_FOUND miss in ops issue 167bb804,
* six times across three orgs.
*/
private creditUpdate;
private creditAdd;
/**
* ADR-232 — pica_credit_remove executor. Atomic DELETE with constant-time
* existence semantics. ADR-252: work credits route directly to
* work_collaborators (composition) / recording_credits (master) via
* atomicRemove — `work_credits` is DROPPED. The recording credits endpoint
* answers 403 INSUFFICIENT_SCOPE on a 0-row delete for EVERY caller as of
* 2026-08-24; the `?atomic=1` the SDK still appends no longer selects a
* behaviour and is accepted-and-ignored for one release.
*/
private creditRemove;
}
//# sourceMappingURL=credits.d.ts.map