Skip to main content
Glama
Replicant-Partners

Firecrawl Agent MCP Server

agent_execute

Execute web searches to autonomously find and extract specific data based on your prompt, returning structured results without requiring URLs.

Instructions

Execute Firecrawl Agent to search, navigate, and gather data from the web. The agent autonomously finds and extracts information based on your prompt. Waits for completion and returns results. Use this for immediate results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescribe what data you want to extract. Be specific about what information you need. Examples: "Find the founders of Anthropic", "Get pricing information for Claude API", "Extract contact emails from YCombinator companies"
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

  • MCP tool handler case for 'agent_execute' that calls FirecrawlClient.executeAgent and handles the response formatting.
    case 'agent_execute': {
      const { prompt, urls, schema, maxCredits } = args as {
        prompt: string;
        urls?: string[];
        schema?: Record<string, any>;
        maxCredits?: number;
      };
    
      const result = await firecrawl.executeAgent({
        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,
                data: result.data,
                creditsUsed: result.creditsUsed,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • TypeScript interface FirecrawlAgentRequest defining the input schema for the agent_execute tool.
    export interface FirecrawlAgentRequest {
      prompt: string;
      schema?: Record<string, any>;
      urls?: string[];
      maxCredits?: number;
    }
  • src/server.ts:58-88 (registration)
    Registration of the 'agent_execute' tool in the TOOLS array, including MCP inputSchema.
      name: 'agent_execute',
      description:
        'Execute Firecrawl Agent to search, navigate, and gather data from the web. The agent autonomously finds and extracts information based on your prompt. Waits for completion and returns results. Use this for immediate results.',
      inputSchema: {
        type: 'object',
        properties: {
          prompt: {
            type: 'string',
            description:
              'Describe what data you want to extract. Be specific about what information you need. Examples: "Find the founders of Anthropic", "Get pricing information for Claude API", "Extract contact emails from YCombinator companies"',
          },
          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'],
      },
    },
  • Core implementation of agent execution via HTTP POST to Firecrawl API /v1/agent endpoint.
    async executeAgent(request: FirecrawlAgentRequest): Promise<FirecrawlAgentResponse> {
      try {
        const response = await fetch(`${this.apiBase}/v1/agent`, {
          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,
          data: data.data,
          creditsUsed: data.creditsUsed,
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the agent 'waits for completion and returns results', which implies synchronous behavior, and hints at cost control via 'maxCredits'. However, it lacks details on error handling, rate limits, authentication needs, timeouts, or what specific data formats are returned. For a complex web scraping/agent tool with no annotations, this is insufficient.

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

Conciseness4/5

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

The description is concise (3 sentences) and front-loaded with the core purpose. Each sentence adds value: first defines the tool, second explains behavior, third gives usage tip. However, the last sentence 'Use this for immediate results' could be more integrated with the context.

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

Completeness2/5

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

Given the tool's complexity (autonomous web agent with 4 parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain the return format, error cases, or operational constraints. The schema covers inputs well, but the description fails to compensate for missing behavioral and output context.

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 4 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain 'prompt' usage further or provide examples for 'schema' or 'maxCredits'). With high schema coverage, the baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Execute Firecrawl Agent to search, navigate, and gather data from the web. The agent autonomously finds and extracts information based on your prompt.' This specifies the verb (execute/search/navigate/gather) and resource (web data). However, it doesn't explicitly differentiate from sibling tools like 'scrape' or 'search' beyond mentioning 'autonomously' and 'agent'.

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

Usage Guidelines3/5

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

The description provides some usage context: 'Use this for immediate results' and mentions the agent will search the web if URLs aren't provided. However, it doesn't explicitly state when to use this tool versus alternatives like 'agent_start' (which might be for async execution), 'scrape', or 'search'. The guidance is implied rather than explicit.

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