@withpica/mcp-server
Version:
MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog
33 lines • 1.71 kB
TypeScript
/**
* ADR-356 D3 — every answer names the catalogue it was done in.
*
* The HTTP route tells the registry which catalogue the connection works in
* (CallerContext.workingCatalogue, from the credential PICA validated). Every
* tool result then carries `working_catalogue: {id, name}`: in `_meta`
* always, and in `structuredContent` when the result has one. When the
* connection has switched away from the catalogue it was connected to, the
* result also ends with one line saying so, so an agent that forgot it
* switched is told on every call (threat T1).
*
* Applied once per result: pica_execute runs the wrapped tool through
* executeTool too, and a result already carrying the note is left as it is.
*/
export interface CatalogueNoteRef {
id: string;
name: string | null;
}
export interface WorkingCatalogueNote extends CatalogueNoteRef {
/** Set only when the connection switched away from its own catalogue. */
switchedFrom?: CatalogueNoteRef;
}
/** The one line a switched connection's every answer ends with. */
export declare function switchedLine(note: WorkingCatalogueNote): string | null;
export declare function withWorkingCatalogue<T>(result: T, requestNote: WorkingCatalogueNote | undefined): T;
/**
* The arguments a confirmation token is bound to (D3): a token made in a
* switched catalogue carries that catalogue, so it cannot be confirmed after
* switching to another, or back. A connection that has not switched hashes
* exactly the arguments it always did.
*/
export declare function confirmationArgs(args: Record<string, unknown>, note: WorkingCatalogueNote | undefined): Record<string, unknown>;
//# sourceMappingURL=working-catalogue-answer.d.ts.map