Run Agent Scan And View Results

Overview

Executes a scanner configuration to discover AI agents from an external platform, then retrieves the scan results including all discovered agents. This is useful for manually triggering scans or reviewing what agents were found.

What you'll build: A complete scan execution with visibility into discovered AI agents ready for publication to Exchange.

Prerequisites

Before starting, ensure you have:

  1. Existing Scanner Configuration
  • A scanner configuration already set up (see "Set Up an Agent Scanner" skill)
  • Valid connection credentials that haven't expired
  1. Anypoint Platform Access
  • Valid authorization token
  • Permission to execute scans in your organization

Step 1: Execute the Scanner

Trigger the scanner to start discovering agents from the configured external platform.

$ curl -X POST ${baseUrl}/api/v1/organizations/{organizationId}/scanner-configurations/{scannerConfigurationId}/execute \
  -H "Authorization: Bearer ${authToken}" \
  -H "Content-Type: application/json"

What happens next: The scan starts asynchronously. You'll receive a 202 Accepted response. The scan runs in the background, discovering agents from the external platform.

Common issues:

  • 409 Conflict: A scan is already running for this configuration. Wait for it to complete.
  • 404 Not Found: Scanner configuration doesn't exist or was deleted
  • 503 Service Unavailable: Scan service is temporarily unavailable

Step 2: Get Scanner Run History

Check the status of your scan by retrieving the run history.

$ curl -X GET ${baseUrl}/api/v1/organizations/{organizationId}/scanner/{scannerId}/runs?page=0&size=20 \
  -H "Authorization: Bearer ${authToken}" \
  -H "Content-Type: application/json"
Captured Variables
scanRunId $.content[0].id
scanStatus $.content[0].status
startedAt $.content[0].startedAt
endedAt $.content[0].endedAt

What happens next: You receive a paginated list of scan runs sorted by most recent. Check the status field to see if your scan is still RUNNING or has COMPLETED.

Common issues:

  • Empty results: No scans have been run yet for this scanner
  • Status shows FAILED: Check the scanner configuration's lastRunStatusDetail for error information

Step 3: View Discovered Agents

Once the scan completes, retrieve the list of discovered agents (staging assets).

$ curl -X GET ${baseUrl}/api/v1/organizations/{organizationId}/scanner/{scannerId}/runs/{scanRunId}/assets?page=0&size=0 \
  -H "Authorization: Bearer ${authToken}" \
  -H "Content-Type: application/json"
Captured Variables
assetId $.content[*].assetId
assetName $.content[*].name
stagingStatus $.content[*].stagingStatus
operationPerformed $.content[*].operationPerformed

What happens next: You receive a list of all agents discovered during the scan, including their names, descriptions, and publication status.

Completion Checklist

After completing all steps, verify:

  • Scan was triggered (202 Accepted)
  • Scan run appears in history with status COMPLETED
  • Staging assets list shows discovered agents
  • Review agent details for accuracy before publication

What You've Built

Your scan execution has produced:

Scan Run Record

  • Timestamped execution record
  • Status tracking (RUNNING -> COMPLETED)
  • Summary of discovered agents

Discovered Agents

  • List of AI agents from the external platform
  • Agent metadata (name, description, capabilities)
  • Staging status for Exchange publication

Next Steps

Now that you've seen the discovered agents:

  1. Review agent details
  • Check the assetPayload/agentCard for each agent's A2A card
  1. Monitor publication
  • Agents with stagingStatus PUBLISHED are live in Exchange
  1. Handle failures
  • Review agents with stagingStatus FAILED for issues
  1. Schedule regular scans
  • Configure automatic scheduled scans for continuous discovery

Tips and Best Practices

Monitoring Scans

  • Poll status: For long-running scans, poll getScannerRunHistory every 30-60 seconds
  • Check summary: The scan run summary field contains counts of discovered/updated/failed agents

Understanding Staging Status

  • NEW: Agent discovered for the first time
  • EXISTING: Agent already known, checked for updates
  • PUBLISHED: Successfully published to Exchange
  • FAILED: Publication failed (check summary for details)
  • PENDING_UPDATE: Agent has changes pending publication

Troubleshooting

Scan Stuck in RUNNING State

Symptoms: Scan status remains RUNNING for an extended period

Possible causes:

  • Large number of agents to discover
  • Network issues with external platform
  • Processing delays

Solutions:

  • Wait longer for large environments (can take 10-30 minutes)
  • Check external platform connectivity
  • Use abort endpoint if scan appears stuck

No Agents Discovered

Symptoms: Scan completes but staging assets list is empty

Possible causes:

  • No agents exist in the external platform
  • Connection credentials lack read permissions
  • Platform-specific filters exclude all agents

Solutions:

  • Verify agents exist in the source platform
  • Check connection credentials have appropriate permissions
  • Review scanner configuration parameters

Scan Fails Immediately

Symptoms: Scan status shows FAILED shortly after starting

Possible causes:

  • Invalid or expired credentials
  • External platform API unavailable
  • Configuration error

Solutions:

  • Test the connection using the connectivity test endpoint
  • Verify external platform is accessible
  • Check lastRunStatusDetail on the scanner configuration