agent_status
Check the status, progress, and results of a Firecrawl Agent web data extraction job. Returns current job status and completed data for 24 hours after processing.
Instructions
Check the status of an asynchronous Firecrawl Agent job. Returns current status, progress, and results if completed. Job results are available for 24 hours after completion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | The job ID returned from agent_start |
Implementation Reference
- src/server.ts:315-328 (handler)MCP tool handler for 'agent_status'. Destructures 'jobId' from input arguments, calls firecrawl.getAgentStatus(jobId), and returns the result as formatted JSON text content.case 'agent_status': { const { jobId } = args as { jobId: string }; const result = await firecrawl.getAgentStatus(jobId); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/server.ts:121-135 (registration)Registration of the 'agent_status' tool in the TOOLS array, including name, description, and input schema definition.{ name: 'agent_status', description: 'Check the status of an asynchronous Firecrawl Agent job. Returns current status, progress, and results if completed. Job results are available for 24 hours after completion.', inputSchema: { type: 'object', properties: { jobId: { type: 'string', description: 'The job ID returned from agent_start', }, }, required: ['jobId'], }, },
- src/server.ts:125-134 (schema)Input schema validation for 'agent_status' tool, requiring a 'jobId' string parameter.inputSchema: { type: 'object', properties: { jobId: { type: 'string', description: 'The job ID returned from agent_start', }, }, required: ['jobId'], },
- Core helper function getAgentStatus in FirecrawlClient that performs the API GET request to /v1/agent/{jobId} to fetch the agent job status and handles errors.async getAgentStatus(jobId: string): Promise<FirecrawlAgentJob> { try { const response = await fetch(`${this.apiBase}/v1/agent/${jobId}`, { method: 'GET', headers: { 'Authorization': `Bearer ${this.apiKey}`, }, }); const data = await response.json() as any; if (!response.ok) { return { id: jobId, status: 'failed', error: data.error || `HTTP ${response.status}: ${response.statusText}`, }; } return { id: jobId, status: data.status, data: data.data, error: data.error, creditsUsed: data.creditsUsed, progress: data.progress, }; } catch (error) { return { id: jobId, status: 'failed', error: error instanceof Error ? error.message : 'Unknown error', }; } }
- src/types/firecrawl.ts:21-28 (schema)TypeScript interface defining the structure of the agent job status response (output schema for the tool).export interface FirecrawlAgentJob { id: string; status: 'pending' | 'running' | 'completed' | 'failed'; data?: any; error?: string; creditsUsed?: number; progress?: number; }