@withpica/mcp-server
Version:
MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog
69 lines • 3.83 kB
JavaScript
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved.
import { formatStructuredList } from "@withpica/mcp-utils";
export class AuditTools {
pica;
constructor(pica) {
this.pica = pica;
}
getTools() {
return [
{
definition: {
name: "pica_audit_list",
scope: "admin",
audiences: ["stdio", "http", "public"],
tier: "read",
description: "List recent MCP tool executions for this workspace. Use to recall what AI actions have been taken — what was created, updated, deleted, or attempted. Each row carries `tier` (read | draft | write | destructive — declared authority) alongside the legacy `risk_level` (safe | mutating | destructive — MCP-standard hint). Only mutating and destructive calls are recorded; read-only queries are not. Scoped to your catalog.",
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: {
limit: {
type: "number",
description: "Max number of entries to return (default 25, max 100).",
},
since: {
type: "string",
description: "ISO 8601 timestamp — only return entries created at or after this time (e.g. '2026-04-01T00:00:00Z').",
},
tool_name: {
type: "string",
description: "Filter to a single tool by exact name (e.g. 'pica_works_create').",
},
risk_level: {
type: "string",
enum: ["safe", "mutating", "destructive"],
description: "Filter by MCP-standard risk classification (3-value hint).",
},
tier: {
type: "string",
enum: ["read", "draft", "write", "destructive"],
description: "Filter by declared authority tier (4-value detail). Prefer tier over risk_level for new clients.",
},
result_status: {
type: "string",
enum: ["success", "error", "confirmation_required"],
description: "Filter by execution outcome.",
},
},
},
},
executor: this.listAudit.bind(this),
},
];
}
async listAudit(args) {
const entries = await this.pica.audit.list({
limit: typeof args.limit === "number" ? args.limit : undefined,
since: typeof args.since === "string" ? args.since : undefined,
tool_name: typeof args.tool_name === "string" ? args.tool_name : undefined,
risk_level: typeof args.risk_level === "string" ? args.risk_level : undefined,
tier: typeof args.tier === "string" ? args.tier : undefined,
result_status: typeof args.result_status === "string" ? args.result_status : undefined,
});
return formatStructuredList(entries, "audit_entry");
}
}
//# sourceMappingURL=audit.js.map