Get Mapping Job
getMappingGet the current state and run metadata for a specific IVR mapping job.
USE WHEN:
- User asks about a specific mapping job by ID
- User wants to know if a mapping run has finished
- User wants run-level metadata (stats, in-flight calls, start/completion times)
- You need a job's currentRun.id to feed into getMappingTree or REST /mapping/{id}/runs
QUERY PARAMS (optional):
- version: Run number (1-indexed) — fetches that specific historical run. Default: latest run.
JOB vs RUN STATUS (critical):
Mapping JOBS cycle status `running` ↔ `idle` and **never reach `completed`** between runs.
Only RUNS reach `completed` / `failed` / `limited`. To detect a finished run, read
`currentRun.status === 'completed'`. **Do NOT poll for `status === 'completed'` at the
job level — that state never arrives.** See getMappingTree for the discovered IVR tree,
available once `currentRun.status === 'completed'`.
RESPONSE FIELDS:
- id: Job UUID.
- status: Job-level status (always `idle` between runs; `running` during an active run).
- tags: String labels for grouping (set via createMapping or update).
- config: mappingMode, maxDepth, maxCalls, probeMode.
- currentRun: The run this response describes — the active/latest run by default, or the run
identified by `version` when supplied. Contains: id, status, runNumber, stats, inFlightCount,
limitReason, startedAt, completedAt. **Prefer `currentRun.status` over the flat `status`.**
- status / runNumber / stats / inFlightCount / limitReason / startedAt / completedAt: Flat-merged
duplicates of currentRun fields, kept for back-compat. New code should read currentRun.*.
USAGE PATTERNS:
- "Is mapping <id> finished?" → getMapping { id } then read `currentRun.status`
- "Show me run 2 of mapping <id>" → getMapping { id, version: 2 }
- "What's the in-flight call count for mapping <id>?" → getMapping { id } then read `currentRun.inFlightCount`
RELATED TOOLS:
- listMappings — find a job by phoneNumber/status/tag/createdAfter (use this before getMapping if you don't have the id)
- getMappingTree — discovered IVR tree once `currentRun.status === 'completed'` (use `?format=flat` for leaf-count / depth aggregation)
- cancelMapping — **DESTRUCTIVE** — stop an in-progress run; only call when explicitly asked
- createMapping — **REAL CALL** — starts a new mapping run (initiates external phone call); only call when explicitly asked
- REST GET /mapping/{id}/runs — run history (REST-only today; may surface as a future MCP tool if eval shows demand)
ERRORS:
- 404: job does not exist or belongs to another workspace (cross-workspace 404 by design — do not retry)
- 400: invalid version (non-integer or < 1)
- 404: requested version not found in this job's run history (response message lists available versions)Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "getMapping"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Mapping job UUID. Find via listMappings if unknown. | |
| version | No | Run number (1-indexed) — fetches that specific historical run. Default: latest run. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique mapping-job identifier. | |
| name | Yes | Job display name. | |
| tags | No | String labels for filtering and grouping. Lowercase alphanumeric + hyphens. | |
| error | No | Error message if the job failed. | |
| stats | No | Aggregate statistics for the current run, populated while the job executes. | |
| config | Yes | Per-job configuration knobs that govern exploration shape and call orchestration. Sensible defaults are applied server-side when fields are omitted on create. | |
| status | Yes | Current job status. Note: mapping jobs typically cycle `running` → `idle` after each run completes — they rarely persist `completed` state. | |
| userId | Yes | User who created the job. | |
| createdAt | Yes | Creation timestamp. | |
| runNumber | No | Flat-merged run number from the active or requested (via `?version=`) run. Phase 04 D-09 — preserved at top level for frontend back-compat alongside the new nested `currentRun` object. | |
| startedAt | No | Most-recent run start timestamp. | |
| updatedAt | Yes | Last update timestamp. | |
| currentRun | No | Nested run summary on single-job responses (Phase 04 D-09 / D-10). Unlike the job-level `status` (which cycles `running` ↔ `idle` and never reaches `completed`), `currentRun.status` CAN reach `completed`/`failed`/`limited`. Read this field to decide whether the discovery is done — do NOT poll for `status === 'completed'` on the job itself. The field name stays `currentRun` even when `?version=N` is supplied — the wrapper describes the run this response describes (active by default, or the historical run identified by `version`). | |
| completedAt | No | Most-recent run completion timestamp. | |
| limitReason | No | Reason the run stopped early (only present when `status` is `limited`). | |
| phoneNumber | Yes | Target phone number in E.164 format. | |
| workspaceId | Yes | Owning workspace. | |
| currentRunId | No | Identifier of the most-recent run (absent if never started). | |
| inFlightCount | No | Currently executing calls. |