Skip to main content
Glama

fetch_website_single

Extract and convert content from a single webpage into clean markdown format using a specified URL, ensuring structured and readable output for further use.

Instructions

Fetch content from a single webpage and convert to clean markdown

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoRequest timeout in milliseconds (default: 10000)
urlYesThe URL to fetch

Implementation Reference

  • src/server.ts:345-364 (registration)
    Registration of the fetch_website_single tool in the TOOLS array, including name, description, and input schema. This is used by the ListToolsRequestHandler.
    { name: "fetch_website_single", description: "Fetch content from a single webpage and convert to clean markdown", inputSchema: { type: "object", properties: { url: { type: "string", description: "The URL to fetch", }, timeout: { type: "number", description: "Request timeout in milliseconds (default: 10000)", default: 10000, }, }, required: ["url"], }, }, ];
  • Input schema for the fetch_website_single tool defining required 'url' parameter and optional 'timeout'.
    inputSchema: { type: "object", properties: { url: { type: "string", description: "The URL to fetch", }, timeout: { type: "number", description: "Request timeout in milliseconds (default: 10000)", default: 10000, }, }, required: ["url"], },
  • Handler implementation for fetch_website_single tool. Validates input, configures scraper options for single page (maxDepth:0, maxPages:1), fetches content, converts to markdown, and returns as text content block.
    case "fetch_website_single": { const { url, timeout = 10000 } = args as any; if (!url) { throw new Error("URL is required"); } try { const options: FetchOptions = { maxDepth: 0, maxPages: 1, timeout, }; const markdown = await scraper.scrapeWebsite(url, options); return { content: [ { type: "text", text: markdown, }, ], }; } catch (error) { throw new Error(`Failed to fetch single page: ${error}`); } }

Other Tools

Related 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/flutterninja9/better-fetch'

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