Get scan status
get_scan_statusPoll a scan and discover its artifacts. Use for "is my scan done?", "where is my scan?", or "what can I fetch?".
The reply includes the scan's state and every artifact's availability and
dashboard link. Use reason for workflow decisions:
* not_complete: keep polling.
* awaiting_approval: fetch get_artifact(security_requirements), present
the requirements, then record the user's decision with approve_scan_phase.
* ok: the scan completed. Read get_security_posture and fetch reports or
diagrams with get_artifact.
* scan_terminated, scan_failed, no_analysis, or action_required: stop
polling. The scan was cancelled or skipped, failed, has yet to start,
or awaits user action, respectively. Follow next_steps for action_required.
A scan takes up to 1 hour. Poll about every 10 minutes while reason is
not_complete.
Relay progress_summary, which the server composes from the progress
fields. When paraphrasing, describe the running stage and sub-step.
scan_phase='2/3' means the second of three stages. Do not turn it into a
percentage: stages have different lengths. job_phase counts sub-steps
within one stage, restarts at each stage, and is shorter in an incremental
scan; scan_phase counts stages across the scan.
Report what is running. Do not invent an ETA: stage durations are
unrecorded, and a paused scan depends on a person's decision.
During an approval pause, scan_phase, scan_stage, job_phase, and job_step
are absent. The message identifies what needs approval. The scan is
paused, so report that state. Do not fill in a position from an earlier poll.
An earlier pinned scan_id returns that scan's lifecycle and artifacts,
with position fields absent. Trent composes a position for the current scan.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_scan_status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scan_id | No | Pin a scan generation. Omit for the latest scan when polling. An earlier scan returns its own lifecycle and artifacts, with position fields absent. Trent composes a live position for the current scan. A scan_id from another project returns an error. | |
| project_id | No | Project ID (provide either project_id or project_name) | |
| project_name | No | Project name (provide either project_id or project_name) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | True when the call itself failed. False for successful calls, including a scan still running, an already approved plan, or a repository classified as non-agentic. The reason field describes these workflow states. | |
| reason | No | A stable snake_case code from the allowed set. Present on every error and on successful calls that carry a workflow state. | |
| status | No | Current scan status: NO_ANALYSIS, CREATED, PENDING, WAITING, BACKPRESSURED, DRAFT, GENERATING_GOALS, GOALS_READY, RUNNING, AWAITING_APPROVAL, COMPLETED, FAILED, CANCELLED, or SKIPPED. An unrecognized value becomes UNKNOWN so polling can continue. Use reason for workflow decisions. | |
| message | No | Exactly one sentence written for the user. Never raw exception text or a backend error string, which may expose private details. | |
| scan_id | No | The scan generation this status reflects. | |
| job_step | No | What that sub-step is, in display words ('Mapping Architecture'). | |
| metadata | No | Caller metadata, such as 'expiration_warning'. Substantive results have their own fields. Never includes exception or backend error text, which may expose private details. | |
| artifacts | No | Every artifact the scan produces, each with artifact_id, kind (document, graph or structured), status, is_available, version, owner_phase, read_path, and dashboard ui_url. Fetch an available artifact with get_artifact(artifact_id=...). 'available' means readable now. reason and awaiting_approval describe an approval pause. | |
| job_phase | No | Sub-step within the current stage as an ordinal, such as '3/6'. Each stage restarts its count, and an incremental scan's stages have fewer sub-steps than a full scan's. Absent until a stage reports a sub-step, during an approval pause, and when the stage is not running. | |
| last_scan | No | Timestamp of the latest project update or scan. | |
| next_steps | No | Recommended next actions based on current status. | |
| project_id | No | Resolved Trent project identifier. | |
| scan_phase | No | Running stage as an ordinal, such as '1/3'. The denominator is the scan's fixed stage count. Use it to describe progress and reason for workflow decisions. Do not convert it to a percentage: stages have different lengths, so '2/3' does not mean two thirds done. Absent during an approval pause, on older single-stage projects, or for a pinned scan_id earlier than the project's latest scan. | |
| scan_stage | No | Running stage name: understand, plan, or secure. Use it to describe progress and reason for workflow decisions. Absent during an approval pause, on older single-stage projects, or for a pinned scan_id earlier than the project's latest scan. | |
| project_name | No | Display name of the Trent project. | |
| schema_version | No | Schema version of the artifact manifest. | |
| skipped_sources | No | Sources the latest scan skipped after a read failure, such as a findings file over the size limit. Its results exclude those sources. Present for the project's latest scan; absent for an earlier pinned scan_id. For the latest scan, absence means the scan reported no skipped source. | |
| progress_summary | No | A sentence describing the scan's progress. Relay it to the user. It combines scan_phase, scan_stage, job_phase, and job_step, and describes uneven stage lengths and readable artifacts. | |
| awaiting_approval | No | Present while the scan pauses for the user's approve or reject decision. Contains stage_id, review_endpoint, and review_url, the app page where the user can also review. Fetch get_artifact(security_requirements), present the requirements, and call approve_scan_phase after the user decides. | |
| latest_commit_sha | No | Commit of the last completed scan, which Trent's current findings describe; never a running scan's. On a pinned scan_id, the commit that scan read, when it read one repository. | |
| scan_repositories | No | Each repository the described scan read, with repo_slug and commit_sha: the pinned scan on a scan_id read, otherwise the running scan. Absent until that scan has recorded its cloned commits. | |
| running_commit_sha | No | While a scan runs, the commit it reads, when it reads one repository. Absent until the running scan has recorded the commit it cloned. | |
| retry_after_seconds | No | With reason rate_limited, how many seconds Trent asks the caller to wait. |