agentbay_attempt_list
List attempts in a project, filtering by status or task to review submissions, track progress, and manage results.
Instructions
List attempts in a project, optionally filtered by status or task
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| status | No | ||
| taskId | No |
Implementation Reference
- src/index.ts:1107-1128 (handler)Handler function for the 'agentbay_attempt_list' tool. It accepts projectId (required), and optional status (SUBMITTED/PASSED/FAILED/MERGED/REJECTED) and taskId filters. Makes a GET request to /api/v1/projects/{projectId}/attempts and returns a formatted list of attempts.
server.tool( 'agentbay_attempt_list', 'List attempts in a project, optionally filtered by status or task', { projectId: z.string().describe('Project ID'), status: z.enum(['SUBMITTED', 'PASSED', 'FAILED', 'MERGED', 'REJECTED']).optional(), taskId: z.string().optional(), }, async ({ projectId, status, taskId }) => { const params = new URLSearchParams(); if (status) params.set('status', status); if (taskId) params.set('taskId', taskId); const data = await apiGet(`/api/v1/projects/${projectId}/attempts?${params.toString()}`); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; const attempts = data.attempts || []; if (!attempts.length) return { content: [{ type: 'text' as const, text: 'No attempts found matching filters.' }] }; const text = attempts.map((a: any) => `- [${a.status}] ${a.summary}\n ID: ${a.id} | Files: ${a.filesChanged} | +${a.linesAdded}/-${a.linesRemoved} | ${a.createdAt?.split('T')[0]}` ).join('\n'); return { content: [{ type: 'text' as const, text: `Attempts:\n\n${text}` }] }; } ); - src/index.ts:1106-1128 (registration)Registration of 'agentbay_attempt_list' tool via server.tool() call on the McpServer instance. The tool is registered with its name, description, Zod schema for inputs, and the handler function.
// Tool 41: Attempt List server.tool( 'agentbay_attempt_list', 'List attempts in a project, optionally filtered by status or task', { projectId: z.string().describe('Project ID'), status: z.enum(['SUBMITTED', 'PASSED', 'FAILED', 'MERGED', 'REJECTED']).optional(), taskId: z.string().optional(), }, async ({ projectId, status, taskId }) => { const params = new URLSearchParams(); if (status) params.set('status', status); if (taskId) params.set('taskId', taskId); const data = await apiGet(`/api/v1/projects/${projectId}/attempts?${params.toString()}`); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; const attempts = data.attempts || []; if (!attempts.length) return { content: [{ type: 'text' as const, text: 'No attempts found matching filters.' }] }; const text = attempts.map((a: any) => `- [${a.status}] ${a.summary}\n ID: ${a.id} | Files: ${a.filesChanged} | +${a.linesAdded}/-${a.linesRemoved} | ${a.createdAt?.split('T')[0]}` ).join('\n'); return { content: [{ type: 'text' as const, text: `Attempts:\n\n${text}` }] }; } ); - src/index.ts:1110-1114 (schema)Input schema for the tool defined using Zod: projectId is a required string, status is an optional enum (SUBMITTED/PASSED/FAILED/MERGED/REJECTED), and taskId is an optional string.
{ projectId: z.string().describe('Project ID'), status: z.enum(['SUBMITTED', 'PASSED', 'FAILED', 'MERGED', 'REJECTED']).optional(), taskId: z.string().optional(), },