Skip to main content
Glama

Get Mapping Job

getMapping
Read-onlyIdempotent

Get 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.runNumber to pass as `version` to getMappingTree (getMappingTree and listMappingRuns take the job id, not a run id)

QUERY PARAMS (optional):
- version: Run number (1-indexed) — fetches that specific historical run. Default: latest run.

STATUS (read currentRun.status):
`currentRun.status` is the status of the run this response describes: `queued`, `running`,
`completed`, `failed` or `limited`. A run has finished when it is `completed`, `failed` or
`limited`. The flat `status` is a copy of that same run's status, not a separate job state,
except that a queued run shows as `idle`; a job that has never run has flat `status` `idle` and
no `currentRun`. See getMappingTree for the discovered IVR tree, available once
`currentRun.status === 'completed'`.

RESPONSE FIELDS:
- id: Job UUID.
- status: Copy of `currentRun.status`, with `queued` shown as `idle`; `idle` when the job has never 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`.**
- 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 — creates a new mapping job, idle; it places no call and starts no run (start one with startMapping)
- listMappingRuns — run history for this job, newest first; pass a runNumber as `version` here to read that run

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

NameRequiredDescriptionDefault
idYesMapping job UUID. Find via listMappings if unknown.
versionNoRun number (1-indexed) — fetches that specific historical run. Default: latest run.

Output Schema

NameRequiredDescriptionDefault
idYesUnique mapping-job identifier.
nameYesJob display name.
tagsNoString labels for filtering and grouping. Lowercase alphanumeric + hyphens.
errorNoError message if the job failed.
statsNoAggregate statistics for the current run, populated while the job executes.
configYesPer-job configuration knobs that govern exploration shape and call orchestration. Sensible defaults are applied server-side when fields are omitted on create.
statusYesOn getMappingJob, the status of the run the response describes (a copy of `currentRun.status`, with `queued` shown as `idle`), or `idle` when the job has never run. createMappingJob returns `idle`: creating a job places no call and starts no run (POST /mapping/{id}/start does).
userIdYesUser who created the job.
createdAtYesCreation timestamp.
runNumberNoFlat-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.
startedAtNoMost-recent run start timestamp.
updatedAtYesLast update timestamp.
currentRunNoNested run summary on single-job responses (Phase 04 D-09 / D-10). `currentRun.status` is the run's own status (`queued`, `running`, `completed`, `failed` or `limited`); read it to decide whether the discovery is done. The flat `status` on the job response is a copy of it, except that `queued` shows as `idle`. 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`).
completedAtNoMost-recent run completion timestamp.
limitReasonNoReason the run stopped early (only present when `status` is `limited`).
phoneNumberYesTarget phone number in E.164 format.
workspaceIdYesOwning workspace.
currentRunIdNoIdentifier of the most-recent run (absent if never started).
inFlightCountNoCurrently executing calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / properties / currentRun / description
      Previous value: -"Nested run summary on single-job responses (Phase 04 D-09 / D-10). Unlike the\njob-level `status` (which cycles `running` ↔ `idle` and never reaches\n`completed`), `currentRun.status` CAN reach `completed`/`failed`/`limited`.\nRead this field to decide whether the discovery is done — do NOT poll for\n`status === 'completed'` on the job itself.\n\nThe field name stays `currentRun` even when `?version=N` is supplied — the\nwrapper describes the run this response describes (active by default, or\nthe historical run identified by `version`).\n"New value: +"Nested run summary on single-job responses (Phase 04 D-09 / D-10).\n`currentRun.status` is the run's own status (`queued`, `running`, `completed`,\n`failed` or `limited`); read it to decide whether the discovery is done. The\nflat `status` on the job response is a copy of it, except that `queued` shows\nas `idle`.\n\nThe field name stays `currentRun` even when `?version=N` is supplied — the\nwrapper describes the run this response describes (active by default, or\nthe historical run identified by `version`).\n"
    • changedOutput schema / properties / currentRun / properties / status / description
      Previous value: -"Run-level status. CAN reach `completed`, unlike the job-level status.\n"New value: +"The run's own status. A run has finished when it is `completed`, `failed` or\n`limited`. The job response's flat `status` copies it, with `queued` shown as `idle`.\n"
    • changedOutput schema / properties / status / description
      Previous value: -"Current job status. Note: mapping jobs typically cycle `running` → `idle`\nafter each run completes — they rarely persist `completed` state.\n"New value: +"On getMappingJob, the status of the run the response describes (a copy of\n`currentRun.status`, with `queued` shown as `idle`), or `idle` when the job\nhas never run. createMappingJob returns `idle`: creating a job places no\ncall and starts no run (POST /mapping/{id}/start does).\n"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/closed-world, so the bar is met, but the description adds substantial context beyond them: the queued→idle flattening quirk, that flat status fields are back-compat duplicates of currentRun, and a precise error contract (cross-workspace 404 by design with 'do not retry', 400 on invalid version, 404 with available-version list). This is exactly the kind of behavior an agent cannot infer from annotations or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and well-sectioned with headers, but roughly 350 words for a 2-parameter read is heavy. The RESPONSE FIELDS block substantially duplicates the existing output schema, and the queued/idle status explanation is restated across both the STATUS section and the status field bullet.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the full lifecycle an agent needs for this tool: what it returns, which status field to trust, how to reach the tree afterward, and each failure mode with whether to retry. Nothing required to invoke it correctly or interpret the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description largely mirrors it for both id and version, so it earns only modest credit. It does add meaning by tying version to the response ('the run this response describes ... or the run identified by version when supplied') and by noting that a job's currentRun.runNumber is the value to pass as version to getMappingTree/listMappingRuns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opening sentence gives a specific verb and resource (get current state and run metadata for an IVR mapping job) and the USE WHEN block scopes it to a single job by ID. It explicitly distinguishes itself from listMappings (find by phoneNumber/status/tag), getMappingTree (tree once completed), and listMappingRuns (run history), so an agent can route without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit USE WHEN list of trigger conditions, plus USAGE PATTERNS mapping natural user questions to exact call shapes (e.g. 'Show me run 2' → getMapping { id, version: 2 }). RELATED TOOLS names the alternatives and states the prerequisite path ('use listMappings before getMapping if you don't have the id') and even flags cancelMapping as destructive/explicit-request-only.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.