Skip to main content
Glama
read-docs.ts695 B
import { BASE_URL } from "./index.js"; import { ReadDocsResponse } from "../tools/types.js"; export async function readDocs(urlToRead: string): Promise<ReadDocsResponse> { 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; }

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