Skip to main content
Glama
alexyangjie

Multi Fetch MCP Server

by alexyangjie

search

Search the web and extract content as markdown with links using the Firecrawl API, enabling web content retrieval for analysis or processing.

Instructions

Searches the web using the Firecrawl search API and scrapes results in markdown and link formats by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
limitNoMaximum number of results to return.

Implementation Reference

  • The 'search' tool handler within call_tool, which uses the firecrawl_client to perform web searches.
    if name == "search":
        try:
            args = Search(**arguments)
        except ValueError as e:
            raise McpError(ErrorData(code=INVALID_PARAMS, message=str(e)))
        try:
            if firecrawl_client is None:
                raise McpError(ErrorData(code=INTERNAL_ERROR, message="Firecrawl client is not initialised"))
            # Firecrawl v2: search(query, options?) with limit and scrapeOptions
            result = await firecrawl_client.search(
                args.query,
                options={"limit": args.limit, "scrapeOptions": {"formats": ["markdown", "links"]}},
            )
        except Exception as e:
            raise McpError(ErrorData(code=INTERNAL_ERROR, message=f"Failed to search via Firecrawl SDK: {e!r}"))
        try:
            json_text = result.model_dump_json()
        except AttributeError:
            json_text = json.dumps(result)
        return [TextContent(type="text", text=json_text)]
  • Pydantic model defining the input schema for the 'search' tool.
    class Search(BaseModel):
        """Parameters for searching using Firecrawl search API."""
        query: Annotated[str, Field(description="Search query string")]
        limit: Annotated[int, Field(default=10, description="Maximum number of results to return.", ge=1)]
  • Registration of the 'search' tool in the list_tools function.
    Tool(
        name="search",
        description="""Searches the web using the Firecrawl search API and scrapes results in markdown and link formats by default.""",
        inputSchema=Search.model_json_schema(),
    ),
    ]
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/alexyangjie/mcp-server-multi-fetch'

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