Skip to main content
Glama
read.ts759 B
import { BASE_URL } from "./index.js"; interface ReadUrlResponse { text: string; library_identifier: string; version_info: string; } export async function readUrl(urlToRead: string): Promise<ReadUrlResponse> { const url = new URL(`${BASE_URL}/read`); url.searchParams.set("url", urlToRead); const response = await fetch(url.toString(), { method: "GET", headers: { "User-Agent": "docfork-mcp", accept: "application/json", }, }); if (!response.ok) { const text = await response.text(); throw new Error( `${response.status} ${response.statusText}: ${text.slice(0, 500)}` ); } // Parse JSON response and return text field const data = await response.json(); return data as ReadUrlResponse; }

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/docfork/docfork-mcp'

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