Skip to main content
Glama

1313

by chatmcp
jina.ts1.07 kB
import { Post } from "@/types/post"; export async function readUrl(url: string): Promise<Post | undefined> { try { const uri = "https://r.jina.ai/"; console.log("jina url", uri, url); const resp = await fetch(uri, { method: "POST", body: JSON.stringify({ url: url, }), headers: { "Content-Type": "application/json", "X-Return-Format": "markdown", "X-Timeout": "10", // "X-No-Cache": "true", Accept: "application/json", }, }); if (!resp.ok) { throw new Error("read url failed with status: " + resp.status); } const res = await resp.json(); console.log("jina resp", res); const { code, status, data } = res; if (code !== 200) { throw new Error("read url failed with status: " + status); } const { title, description, content } = data; return { url: url, title: title, description: description, content: content, }; } catch (err) { console.log("read url failed: ", err); throw err; } }

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/chatmcp/mcpso'

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