report_outcome
Report job execution outcomes to the Maiat trust oracle, providing real data on success, failure, partial completion, or expiration status.
Instructions
Report the outcome of a job after executing it. This feeds the Maiat trust oracle with real outcome data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | The job ID to report outcome for | |
| outcome | Yes | The outcome of the job | |
| reporter | No | Address of the reporter (optional) | |
| note | No | Free-form note about the outcome (optional) |
Implementation Reference
- packages/mcp-server/src/index.ts:255-287 (handler)The MCP tool definition and handler for 'report_outcome' in the mcp-server package. It parses the inputs and calls the SDK's reportOutcome method.
server.tool( "report_outcome", "Report the outcome of a job after executing it. This feeds the Maiat trust oracle with real outcome data.", { jobId: z.string().describe("The job ID to report outcome for"), outcome: z .enum(["success", "failure", "partial", "expired"]) .describe("The outcome of the job"), reporter: z .string() .optional() .describe("Address of the reporter (optional)"), note: z .string() .optional() .describe("Free-form note about the outcome (optional)"), }, async ({ jobId, outcome, reporter, note }) => { try { const data = await sdk.reportOutcome({ jobId, outcome, reporter: reporter ?? undefined, note: note ?? undefined, }); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; - packages/sdk/src/index.ts:227-232 (helper)The underlying SDK implementation of reportOutcome, which sends a POST request to the Maiat API.
async reportOutcome(params: OutcomeParams): Promise<OutcomeResult> { return this.request<OutcomeResult>("/api/v1/outcome", { method: "POST", body: JSON.stringify(params), }); }