Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:CrewAIInc CrewAI Serply Webpage To Markdown Tool

From Leeroopedia
Revision as of 11:09, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/CrewAIInc_CrewAI_Serply_Webpage_To_Markdown_Tool.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Tools, Web_Scraping, Content_Conversion
Last Updated 2026-02-11 00:00 GMT

Overview

SerplyWebpageToMarkdownTool fetches a webpage and converts it to markdown format using the Serply.io request API, making web content more digestible for LLMs.

Description

The SerplyWebpageToMarkdownTool extends RagTool and sends a POST request to https://api.serply.io/v1/request with a JSON payload specifying the target URL, GET method, and "markdown" response type. It accepts a proxy_location parameter constrained to a Literal set of supported country codes (US, CA, IE, GB, FR, DE, SE, IN, JP, KR, SG, AU, BR). The headers are initialized at class level with the SERPLY_API_KEY from the environment. The _run method sets the proxy location header if configured and returns the raw markdown text response from the API.

Usage

Use this tool when a CrewAI agent needs to convert raw web pages into a markdown format suitable for LLM processing, summarization, or text analysis within multi-tool research workflows.

Code Reference

Source Location

  • Repository: CrewAI
  • File: lib/crewai-tools/src/crewai_tools/tools/serply_api_tool/serply_webpage_to_markdown_tool.py
  • Lines: 1-59

Signature

class SerplyWebpageToMarkdownToolSchema(BaseModel):
    url: str = Field(..., description="Mandatory url you want to use to fetch and convert to markdown")

class SerplyWebpageToMarkdownTool(RagTool):
    name: str = "Webpage to Markdown"
    description: str = "A tool to perform convert a webpage to markdown to make it easier for LLMs to understand"
    args_schema: type[BaseModel] = SerplyWebpageToMarkdownToolSchema
    request_url: str = "https://api.serply.io/v1/request"
    proxy_location: Literal["US", "CA", "IE", "GB", "FR", "DE", "SE", "IN", "JP", "KR", "SG", "AU", "BR"] = "US"
    env_vars: list[EnvVar]  # SERPLY_API_KEY

    def _run(self, url: str) -> str:
        ...

Import

from crewai_tools import SerplyWebpageToMarkdownTool

I/O Contract

Inputs

Name Type Required Description
url str Yes The URL of the webpage to fetch and convert to markdown

Outputs

Name Type Description
_run() returns str The webpage content converted to markdown format

Usage Examples

Basic Usage

from crewai_tools import SerplyWebpageToMarkdownTool

tool = SerplyWebpageToMarkdownTool(proxy_location="US")
result = tool._run(url="https://example.com/article")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment