list_threads
Retrieve and filter conversation threads from the402.ai marketplace to monitor active, completed, or disputed transactions as a buyer or seller.
Instructions
List your conversation threads on the402.ai. Shows threads where you are the agent (buyer) or provider (seller). Filter by status to find active, completed, or disputed threads. Requires API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter by thread status | |
| limit | No | Results per page (default: 20) | |
| offset | No | Pagination offset |
Implementation Reference
- src/tools/threads.ts:50-62 (handler)The handler function for the list_threads tool. It calls the client's authGet method to fetch threads from the /v1/threads endpoint with optional status, limit, and offset filters.
async ({ status, limit, offset }) => { const params: Record<string, string> = {}; if (status) params.status = status; if (limit !== undefined) params.limit = String(limit); if (offset !== undefined) params.offset = String(offset); const result = await client.authGet("/v1/threads", params); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } - src/tools/threads.ts:30-49 (registration)Registration of the list_threads tool, including its description and schema definition using zod.
server.tool( "list_threads", "List your conversation threads on the402.ai. Shows threads where you are the agent (buyer) or provider (seller). Filter by status to find active, completed, or disputed threads. Requires API key.", { status: z .enum([ "inquiry", "negotiating", "accepted", "in_progress", "completed", "verified", "disputed", "cancelled", ]) .optional() .describe("Filter by thread status"), limit: z.number().optional().describe("Results per page (default: 20)"), offset: z.number().optional().describe("Pagination offset"), },