get_job
Read an asynchronous job submitted with submit_optimise_job: its status, and once it has finished, its result inline — exactly the body the synchronous tool would have returned. Status is queued, running, succeeded or failed; the answer's terminal field says whether the job will ever leave the status it is in, so poll while that is false. POLLING IS FREE: the gateway meters the submission and not the reads, deliberately, because a poll that costs quota is a poll a caller rations, and a rationed poll is how a job that finished in ten seconds gets noticed four minutes later. Check every few seconds rather than guessing at a duration. units_charged is what the SUBMISSION drew, and refunded says whether a failure handed it back — a failed job shows both, because reporting zero would be a lie about what was charged. Webhooks are the alternative to polling and exist for humans wiring infrastructure, not for agents in a loop. A job belongs to the key that submitted it (or another key of the same identity); anyone else's id answers NOT FOUND rather than forbidden, because confirming an id exists is itself a disclosure. Requires the MapMap gateway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The job id returned by `submit_optimise_job`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The job id. | |
| kind | Yes | `optimise`, `replan` or `matrix`. | |
| error | No | Why it failed, once `status` is `failed`. | |
| result | No | The answer, inline, once `status` is `succeeded` — exactly the body the synchronous tool would have returned. | |
| status | Yes | `queued`, `running`, `succeeded` or `failed`. Only `succeeded` and `failed` are terminal; keep polling on the other two. | |
| refunded | Yes | Whether a failure refunded the submission's units. | |
| terminal | Yes | Whether `status` is one this job will never leave. | |
| created_at | Yes | RFC 3339 UTC submission time. | |
| started_at | No | RFC 3339 UTC time a worker picked it up. | |
| finished_at | No | RFC 3339 UTC time it finished, either way. | |
| units_charged | Yes | Metered units the SUBMISSION drew. This is what was charged; `refunded` says whether it came back. | |
| webhook_status | No | `delivered` or `delivery_failed`, once a webhook was attempted. |