Skip to main content
Glama
Replicant-Partners

Firecrawl Agent MCP Server

agent_start

Initiates web research tasks to extract structured data from specified or discovered URLs, returning a job ID for progress monitoring.

Instructions

Start a Firecrawl Agent job asynchronously. Returns a job ID immediately without waiting for completion. Use this for long-running research tasks. Poll with agent_status to check progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescribe what data you want to extract. Be specific about what information you need.
urlsNoOptional: Specific URLs to search. If not provided, agent will search the web.
schemaNoOptional: JSON schema for structured output. Define the exact structure you want the data returned in.
maxCreditsNoOptional: Maximum credits to spend on this request. Use to control costs.

Implementation Reference

  • Core handler that implements agent_start by POSTing the agent request to Firecrawl API /v1/agent/start endpoint and returning the job ID.
    async startAgent(request: FirecrawlAgentRequest): Promise<FirecrawlAgentResponse> {
      try {
        const response = await fetch(`${this.apiBase}/v1/agent/start`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${this.apiKey}`,
          },
          body: JSON.stringify(request),
        });
    
        const data = await response.json() as any;
    
        if (!response.ok) {
          return {
            success: false,
            error: data.error || `HTTP ${response.status}: ${response.statusText}`,
          };
        }
    
        return {
          success: true,
          id: data.id,
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • MCP server tool call handler for 'agent_start': destructures arguments, calls FirecrawlClient.startAgent, formats response with jobId or error.
    case 'agent_start': {
      const { prompt, urls, schema, maxCredits } = args as {
        prompt: string;
        urls?: string[];
        schema?: Record<string, any>;
        maxCredits?: number;
      };
    
      const result = await firecrawl.startAgent({
        prompt,
        urls,
        schema,
        maxCredits,
      });
    
      if (!result.success) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${result.error}`,
            },
          ],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                success: true,
                jobId: result.id,
                message:
                  'Agent job started. Use agent_status with this jobId to check progress.',
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • MCP tool schema definition for agent_start, including name, description, and JSON inputSchema matching FirecrawlAgentRequest.
    {
      name: 'agent_start',
      description:
        'Start a Firecrawl Agent job asynchronously. Returns a job ID immediately without waiting for completion. Use this for long-running research tasks. Poll with agent_status to check progress.',
      inputSchema: {
        type: 'object',
        properties: {
          prompt: {
            type: 'string',
            description:
              'Describe what data you want to extract. Be specific about what information you need.',
          },
          urls: {
            type: 'array',
            items: { type: 'string' },
            description:
              'Optional: Specific URLs to search. If not provided, agent will search the web.',
          },
          schema: {
            type: 'object',
            description:
              'Optional: JSON schema for structured output. Define the exact structure you want the data returned in.',
          },
          maxCredits: {
            type: 'number',
            description:
              'Optional: Maximum credits to spend on this request. Use to control costs.',
          },
        },
        required: ['prompt'],
      },
    },
  • TypeScript interface defining the input parameters for agent_start, used in FirecrawlClient.startAgent.
    export interface FirecrawlAgentRequest {
      prompt: string;
      schema?: Record<string, any>;
      urls?: string[];
      maxCredits?: number;
    }
  • src/server.ts:215-217 (registration)
    Registers the ListTools handler that exposes the agent_start tool via the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: TOOLS };
    });
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: asynchronous execution ('Returns a job ID immediately without waiting for completion'), long-running nature, and the need for polling. However, it doesn't mention potential costs, rate limits, error handling, or what happens if maxCredits is exceeded. For a tool with no annotations, this is good but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, zero waste. First sentence states the core action and immediate return. Second provides usage context. Third gives essential follow-up instruction. Every sentence earns its place, and the structure is front-loaded with the most critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (asynchronous job execution with 4 parameters, no output schema, and no annotations), the description is mostly complete. It covers the asynchronous behavior, polling requirement, and high-level use case. However, it lacks details on error responses, job lifecycle, or output format expectations. With no output schema, some guidance on what 'agent_status' returns would help, but the description is sufficient for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain prompt formatting best practices or credit costs). Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the verb ('Start'), resource ('Firecrawl Agent job'), and key behavioral trait ('asynchronously'). It distinguishes from sibling tools by mentioning 'Poll with agent_status to check progress' and contrasts with 'agent_execute' by emphasizing the asynchronous nature. The purpose is specific and unambiguous.

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

Usage Guidelines5/5

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

Explicit guidance is provided: 'Use this for long-running research tasks' tells when to use it, and 'Poll with agent_status to check progress' names the alternative for checking status. It implicitly contrasts with 'agent_execute' (likely synchronous) and 'scrape'/'search' (different functionalities). The guidelines are comprehensive and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Replicant-Partners/Firecrawler-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server