Get Swarm
GET /api/agents/swarm/{swarm_id}
Get detailed information about a specific swarm
Retrieves comprehensive details about a swarm by ID, checking both active swarms and historical swarm data. Returns full swarm details including current status, execution progress, agent count, and task information.
@param swarm_id: Unique swarm identifier @param swarm_engine: Injected swarm execution engine @returns SwarmResponse with complete swarm details including status and progress @raises HTTPException: If swarm not found (404) or retrieval fails (500)
Search Order:
- Check active swarms dictionary first
- Fall back to swarm history if not active
- Return 404 if not found in either location
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”Successful Response
Response model for swarm operations.
Represents the current state and metadata of a multi-agent swarm, including execution status, progress tracking, and swarm composition details. Used for swarm creation responses, status queries, and monitoring updates.
Fields:
swarm_id: Unique swarm identifierstatus: Current swarm status (pending, active, completed, failed, cancelled)swarm_type: Type of swarmcreated_at: Creation timestamptask_description: Task descriptionagent_count: Number of agents in swarmprogress: Task completion progress (0.0-1.0)
Status Values:
pending: Swarm created but not yet startedactive: Swarm currently executingcompleted: Swarm finished successfullyfailed: Swarm failed with errorcancelled: Swarm cancelled by user or system
Progress Range: 0.0 (0%) to 1.0 (100%), calculated based on completed sub-tasks
Usage: Returned from swarm creation, status queries, and list operations.
JSON Example:
{
"swarmId": "swarm_abc123",
"status": "active",
"swarmType": "code_analysis",
"createdAt": "2024-12-20T10:30:00Z",
"taskDescription": "Analyze Python codebase for type safety issues",
"agentCount": 5,
"progress": 0.65
}
Integration:
- SwarmExecutionEngine: Updates status and progress during execution
- Monitoring Dashboard: Displays swarm state in real-time
- Analytics System: Tracks swarm performance and completion rates
object
Unique swarm identifier
Current swarm status
Type of swarm
Creation timestamp
Task description
Number of agents in swarm
Task completion progress (0.0-1.0)
Validation Error