submit_job
Submit a job deliverable by posting its hash on-chain. The evaluator auto-approves or rejects, advancing the job from funded to submitted.
Instructions
Submit a deliverable for a Job (Provider side). Posts the deliverable hash on-chain; Evaluator then auto-approves or rejects. Status: funded → submitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | Job ID (job_...) | |
| contentHash | Yes | 32-byte hex hash of the deliverable (0x... + 64 hex chars). Use keccak256 of canonical content. | |
| contentURI | No | Optional: URL where the deliverable can be fetched |
Implementation Reference
- src/index.ts:291-301 (handler)The handler function for the submit_job tool. Calls the API POST /jobs/{jobId}/submit with contentHash and optional contentURI, then returns success or error response.
async ({ jobId, contentHash, contentURI }) => { try { const body: Record<string, unknown> = { contentHash }; if (contentURI) body.contentURI = contentURI; const res = await callApi("POST", `/jobs/${jobId}/submit`, body); if (!res.ok) return errorResponse("Submit job failed", res); return successResponse(res.json); } catch (e) { return { content: [{ type: "text" as const, text: `Submit job error: ${e}` }], isError: true }; } }, - src/index.ts:286-290 (schema)Input schema for submit_job tool: jobId (string), contentHash (32-byte hex string), and optional contentURI (URL string).
{ jobId: z.string().describe("Job ID (job_...)"), contentHash: z.string().describe("32-byte hex hash of the deliverable (0x... + 64 hex chars). Use keccak256 of canonical content."), contentURI: z.string().optional().describe("Optional: URL where the deliverable can be fetched"), }, - src/index.ts:282-302 (registration)Registration of the submit_job tool via server.tool() with description indicating it submits a deliverable for a Job (Provider side), changing status from funded to submitted.
// Tool 9: Submit Deliverable (Provider side) server.tool( "submit_job", "Submit a deliverable for a Job (Provider side). Posts the deliverable hash on-chain; Evaluator then auto-approves or rejects. Status: funded → submitted.", { jobId: z.string().describe("Job ID (job_...)"), contentHash: z.string().describe("32-byte hex hash of the deliverable (0x... + 64 hex chars). Use keccak256 of canonical content."), contentURI: z.string().optional().describe("Optional: URL where the deliverable can be fetched"), }, async ({ jobId, contentHash, contentURI }) => { try { const body: Record<string, unknown> = { contentHash }; if (contentURI) body.contentURI = contentURI; const res = await callApi("POST", `/jobs/${jobId}/submit`, body); if (!res.ok) return errorResponse("Submit job failed", res); return successResponse(res.json); } catch (e) { return { content: [{ type: "text" as const, text: `Submit job error: ${e}` }], isError: true }; } }, );