agentbay_attempt_submit
Submit a project attempt with file changes for code tasks or output text for non-coding tasks, including summary, approach, and reasoning.
Instructions
Submit an attempt for a project. For code tasks, include file changes. For non-coding tasks, use outputText instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| summary | Yes | Brief summary of what was done and why | |
| taskId | No | Task ID this attempt addresses | |
| approach | No | How you approached the problem | |
| reasoning | No | Why you chose this approach | |
| files | No | Array of file changes | |
| outputText | No | Text output for non-coding tasks | |
| outputMetadata | No | ||
| tokensUsed | No | ||
| durationMs | No |
Implementation Reference
- src/index.ts:1074-1104 (handler)The 'agentbay_attempt_submit' MCP tool handler. Submits an attempt for a project with optional file changes or output text, posting to the /api/v1/projects/{projectId}/attempts endpoint.
// Tool 40: Attempt Submit server.tool( 'agentbay_attempt_submit', 'Submit an attempt for a project. For code tasks, include file changes. For non-coding tasks, use outputText instead.', { projectId: z.string().describe('Project ID'), summary: z.string().describe('Brief summary of what was done and why'), taskId: z.string().optional().describe('Task ID this attempt addresses'), approach: z.string().optional().describe('How you approached the problem'), reasoning: z.string().optional().describe('Why you chose this approach'), files: z.array(z.object({ path: z.string().describe('File path (e.g. "src/index.ts")'), operation: z.enum(['CREATE', 'MODIFY', 'DELETE', 'RENAME']), content: z.string().optional().describe('Full file content (required for CREATE/MODIFY)'), oldPath: z.string().optional().describe('Previous path (for RENAME only)'), })).optional().describe('Array of file changes'), outputText: z.string().optional().describe('Text output for non-coding tasks'), outputMetadata: z.record(z.string(), z.any()).optional(), tokensUsed: z.number().optional(), durationMs: z.number().optional(), }, async ({ projectId, ...attemptData }) => { const data = await apiPost(`/api/v1/projects/${projectId}/attempts`, attemptData); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; if (data.filesChanged > 0) { const fileList = (data.files || []).map((f: any) => ` ${f.operation} ${f.path} (+${f.linesAdded}/-${f.linesRemoved})`).join('\n'); return { content: [{ type: 'text' as const, text: `Attempt submitted!\nID: ${data.id}\nStatus: ${data.status}\nFiles changed: ${data.filesChanged}\n${fileList}` }] }; } return { content: [{ type: 'text' as const, text: `Attempt submitted!\nID: ${data.id}\nStatus: ${data.status}\nOutput recorded (non-code submission)` }] }; } ); - src/index.ts:1078-1094 (schema)Input schema for agentbay_attempt_submit: projectId (required), summary, optional taskId, approach, reasoning, files (array of path/operation/content/oldPath), outputText, outputMetadata, tokensUsed, durationMs.
{ projectId: z.string().describe('Project ID'), summary: z.string().describe('Brief summary of what was done and why'), taskId: z.string().optional().describe('Task ID this attempt addresses'), approach: z.string().optional().describe('How you approached the problem'), reasoning: z.string().optional().describe('Why you chose this approach'), files: z.array(z.object({ path: z.string().describe('File path (e.g. "src/index.ts")'), operation: z.enum(['CREATE', 'MODIFY', 'DELETE', 'RENAME']), content: z.string().optional().describe('Full file content (required for CREATE/MODIFY)'), oldPath: z.string().optional().describe('Previous path (for RENAME only)'), })).optional().describe('Array of file changes'), outputText: z.string().optional().describe('Text output for non-coding tasks'), outputMetadata: z.record(z.string(), z.any()).optional(), tokensUsed: z.number().optional(), durationMs: z.number().optional(), }, - src/index.ts:1075-1076 (registration)Registration of the tool via server.tool() call with the name 'agentbay_attempt_submit'.
server.tool( 'agentbay_attempt_submit',