Skip to main content
Glama

Trigger an ad-hoc scan

trigger_scan

Trigger an ad-hoc scan (permission: edit)

Run a scan against a custom url (Web/TV) or apk (Android, via /uploads), optionally replaying a saved journeyId. android_* requires apk; web_* and tv_* require url (mutually exclusive) — a 400 is returned when the target type and scanType disagree. A field that cannot take effect for the scan is a 400 with code field_not_applicable on its path: viewport and bannerOverride apply to web scans without a journeyId only, country to every scan except a web or TV journey replay (a journeyId replays at the journey's recorded location and viewport), tvPlatform to tv_* scans, maxDepth to android_compliance scans; journeyId on android_compliance is refused (only android_journey replays a journey). url is an absolute http(s) URL. The scan runs on an ephemeral target; save a test with POST /targets. country decides the proxy location, browser language and timezone; without it the scan runs from DE (locale and timezone are not accepted). Set dryRun=true to produce diffs + score for a CI gate WITHOUT mutating any journey baseline. The scan may start later if the queue is temporarily unavailable; poll its status. idempotencyKey (sent as the Idempotency-Key header): retrying the same call with the same value replays the original answer; the same value with different arguments is 422 idempotency_conflict, and 409 idempotent_in_progress means wait error.meta.retryAfter seconds and retry.

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": {
      "scanType": "<scanType>"
    },
    "name": "trigger_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
apkNoThe uploaded app: `{ gcsPath }` as POST /uploads answered it (android_* scans).
urlNoAbsolute http(s) URL to scan (web_* and tv_* scans).
dryRunNotrue: produce diffs and score for a CI gate without changing any journey baseline; default false.
countryNoScan country (proxy location, browser language, timezone): CZ, DE, AT, IT, ES, NL, DK, FR, BE, PL, IE, SK; default DE
maxDepthNoHow deep the app crawl goes (1-5); android_compliance scans only.
scanTypeYesThe scan to run: android_* takes `apk`, web_* and tv_* take `url`.
viewportNoBrowser viewport; web scans without a journeyId only.
journeyIdNoA saved journey to replay (GET /journeys); required for android_journey, refused for android_compliance.
projectIdNoRequired with an organization key; must be the key's project with a project key. Missing (organization key) or not a UUID: 400 invalid_request on path projectId; a project outside the key's reach: 404.
tvPlatformNoThe TV platform to emulate; tv_* scans only.
bannerOverrideNoA consent-banner override object for the scan; web scans without a journeyId only.
idempotencyKeyNoOptional Idempotency-Key: reuse the same value when retrying this exact call so it is applied once.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / apk / description
      Added value: +"The uploaded app: `{ gcsPath }` as POST /uploads answered it (android_* scans)."
    • addedInput schema / properties / bannerOverride / description
      Added value: +"A consent-banner override object for the scan; web scans without a journeyId only."
    • addedInput schema / properties / dryRun / description
      Added value: +"true: produce diffs and score for a CI gate without changing any journey baseline; default false."
    • addedInput schema / properties / journeyId / description
      Added value: +"A saved journey to replay (GET /journeys); required for android_journey, refused for android_compliance."
    • addedInput schema / properties / maxDepth / description
      Added value: +"How deep the app crawl goes (1-5); android_compliance scans only."
    • addedInput schema / properties / scanType / description
      Added value: +"The scan to run: android_* takes `apk`, web_* and tv_* take `url`."
    • addedInput schema / properties / tvPlatform / description
      Added value: +"The TV platform to emulate; tv_* scans only."
    • addedInput schema / properties / url / description
      Added value: +"Absolute http(s) URL to scan (web_* and tv_* scans)."
    • addedInput schema / properties / viewport / description
      Added value: +"Browser viewport; web scans without a journeyId only."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: permission requires edit, 400 with field_not_applicable per path, ephemeral target lifecycle, dryRun does not mutate journey baselines, and idempotencyKey retry semantics with 422 idempotency_conflict and 409 idempotent_in_progress plus error.meta.retryAfter. The conditional idempotency via header coexists with idempotentHint=false rather than contradicting it, since a fresh call without the key still creates a new scan.

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?

The permission line and target-type rule are well front-loaded, but the middle section is one sprawling semicolon-and-em-dash chain of applicability rules that is hard to parse on a first read. A few lines restate schema facts verbatim (url is an absolute http(s) URL, country default DE), which is redundant at 100% schema coverage.

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?

For a 12-parameter, mutation-style, open-world tool with no output schema, it covers auth, error codes, field applicability, idempotency, async queueing and the dryRun safety story. An agent has enough to construct a correct call and handle the common failure modes.

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 already 100%, so per-parameter meaning is largely covered, but the description adds cross-parameter rules the schema cannot express: android_* requires apk, web_*/tv_* require url and are mutually exclusive, and which fields are refused per scanType (viewport/bannerOverride without journeyId, country except on web/TV journey replay, tvPlatform only on tv_*, maxDepth only on android_compliance). That is real added value over the flat schema.

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?

States a specific verb and resource ("Trigger an ad-hoc scan") and immediately scopes the targets it accepts (custom url for Web/TV, apk for Android). The word "ad-hoc" plus the ephemeral-target note distinguishes it from rerun_target_scan and request_public_scan among the siblings.

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

Usage Guidelines4/5

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

Gives clear conditions: use dryRun=true for a CI gate, save a test with POST /targets if you want the target persisted, and poll status when the queue is unavailable. It never explicitly names an alternative tool (e.g. rerun_target_scan vs this) so the exclusion guidance is only implicit.

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.

Resources