Skip to main content
Glama

mcp-server-requests

by coucya

fetch_to_file

Retrieve web content from a URL and save it to a specified file, with options for raw HTML, cleaned HTML, or Markdown conversion.

Instructions

获取网页内容并保存到文件。 - 如果是 HTML, 则根据 return_content 返回合适的内容, - 如果不是 HTML,但是是 Text 或 Json 内容,则直接保存其内容。 - 如果是其它类型的内容,则返回错误信息。

Args: url (str): 要获取的网页 URL。 file_path (str): 要保存到的文件路径,必须是绝对路径。 return_content ("raw" | "basic_clean" | "strict_clean" | "markdown", optional): 默认为 "markdown",用于控制返回 html 内容的方式, - 如果为 raw,返回原始 HTML 内容。 - 如果为 basic_clean,返回过滤后的 HTML 内容,过滤掉所有不会显示的标签,如 script, style 等。 - 如果为 strict_clean,返回过滤后的 HTML 内容,过滤掉所有不会显示的标签,如 script, style 等,并且会删除大部分无用的 HTML 属性。 - 如果为 markdown,HTML 转换为 Markdown 后返回。 Returns: - 成功时返回文件保存路径 - 如果路径不安全则返回错误信息

Input Schema

NameRequiredDescriptionDefault
file_pathYes
return_contentNomarkdown
urlYes

Input Schema (JSON Schema)

{ "properties": { "file_path": { "title": "File Path", "type": "string" }, "return_content": { "default": "markdown", "enum": [ "raw", "basic_clean", "strict_clean", "markdown" ], "title": "Return Content", "type": "string" }, "url": { "title": "Url", "type": "string" } }, "required": [ "url", "file_path" ], "title": "fetch_to_fileArguments", "type": "object" }

Other Tools from mcp-server-requests

Related Tools

    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/coucya/mcp-server-requests'

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