@withpica/mcp-server
Version:
MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog
70 lines • 3.14 kB
JavaScript
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved.
import { formatSuccess } from "@withpica/mcp-utils";
export class DisputesTools {
pica;
constructor(pica) {
this.pica = pica;
}
getTools() {
return [
{
definition: {
name: "pica_disputes_list",
scope: "read:catalog",
audiences: ["stdio", "http", "public"],
tier: "read",
description: "Use when the user asks: 'show me my open disputes', 'what's contested?', 'list active disputes'. " +
"List disputes — shows disputes received (filed against your works), " +
"disputes filed by you, and credits with disputed attestation status. " +
"Use this for questions like 'do I have any disputes?' or " +
"'are any of my credits disputed?'.",
workflows: "infrastructure",
vernacular_kind: "creator-entry",
inputSchema: {
type: "object",
properties: {
status: {
// The three values GET /api/admin/disputes actually branches
// on. Stated in prose only until A10 (2026-08-24).
type: "string",
enum: ["open", "resolved", "all"],
description: "Filter by status: open, resolved, or all (default: all)",
},
},
},
},
executor: this.listDisputes.bind(this),
},
];
}
async listDisputes(args) {
const data = await this.pica.disputes.list({
status: args.status,
});
const received = data?.received || [];
const filed = data?.filed || [];
const disputedCredits = data?.disputed_credits || [];
const totalCount = received.length + filed.length + disputedCredits.length;
const hints = [];
if (received.length > 0) {
hints.push({
gap: "disputes_received",
suggestion: `You have ${received.length} dispute(s) filed against your works — review and respond`,
count: received.length,
severity: "critical",
});
}
if (disputedCredits.length > 0) {
hints.push({
gap: "disputed_credits",
suggestion: `${disputedCredits.length} credit(s) have disputed attestation — verify splits are correct`,
count: disputedCredits.length,
severity: "important",
});
}
return formatSuccess(totalCount > 0
? `Found ${totalCount} dispute(s): ${received.length} received, ${filed.length} filed, ${disputedCredits.length} disputed credits`
: "No disputes found — all clear", data, hints);
}
}
//# sourceMappingURL=disputes.js.map