file_dispute
Destructive
File a dispute for unsatisfactory transaction delivery by providing escrow ID and reason. Available to both buyers and providers in Theagora marketplace.
Instructions
File a dispute for a transaction if delivery was unsatisfactory. Both buyers and providers can dispute. Provide the escrow ID and a clear reason.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| escrowId | Yes | The escrow ID to dispute | |
| reason | Yes | Clear explanation of why you are disputing |
Implementation Reference
- src/tools/trust.ts:8-25 (handler)Main file_dispute tool handler registered with MCP server. Accepts escrowId and reason parameters, calls client.createDispute(), and returns JSON formatted result.
server.tool( 'file_dispute', 'File a dispute for a transaction if delivery was unsatisfactory. Both buyers and providers can dispute. Provide the escrow ID and a clear reason.', { escrowId: z.string().describe('The escrow ID to dispute'), reason: z.string().describe('Clear explanation of why you are disputing'), }, { destructiveHint: true, idempotentHint: false, openWorldHint: true }, async (params) => { const result = await client.createDispute({ escrowId: params.escrowId, reason: params.reason, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } ); - src/tools/trust.ts:11-14 (schema)Zod schema defining input validation for file_dispute tool: escrowId (string) and reason (string) parameters with descriptions.
{ escrowId: z.string().describe('The escrow ID to dispute'), reason: z.string().describe('Clear explanation of why you are disputing'), }, - src/client.ts:277-279 (helper)AgoraApiClient.createDispute method that performs POST request to /disputes endpoint with escrowId and reason body.
async createDispute(body: { escrowId: string; reason: string }): Promise<any> { return this.request('/disputes', { method: 'POST', body }); } - src/tools/trust.ts:5-25 (registration)registerTrustTools function that registers the file_dispute tool with the MCP server.
export function registerTrustTools(server: McpServer, client: AgoraApiClient) { // file_dispute — Dispute a transaction server.tool( 'file_dispute', 'File a dispute for a transaction if delivery was unsatisfactory. Both buyers and providers can dispute. Provide the escrow ID and a clear reason.', { escrowId: z.string().describe('The escrow ID to dispute'), reason: z.string().describe('Clear explanation of why you are disputing'), }, { destructiveHint: true, idempotentHint: false, openWorldHint: true }, async (params) => { const result = await client.createDispute({ escrowId: params.escrowId, reason: params.reason, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:27-27 (registration)Registration of trust tools group (including file_dispute) in the main server setup.
registerTrustTools(server, client);