Skip to main content
Glama

GitMCP

index.ts1.06 kB
import { z } from "zod"; import { getRepoData } from "../../shared/repoData.js"; import { fetchUrlContent } from "./commonTools.js"; import { getHandlerByRepoData } from "./repoHandlers/handlers.js"; import type { Tool } from "./repoHandlers/RepoHandler.js"; export function getMcpTools( env: Env, requestHost: string, requestUrl?: string, ctx?: any, ): Array<Tool> { const repoData = getRepoData({ requestHost, requestUrl }); const handler = getHandlerByRepoData(repoData); const handlerTools = handler.getTools(repoData, env, ctx); return [ ...handlerTools, { name: "fetch_generic_url_content", description: "Generic tool to fetch content from any absolute URL, respecting robots.txt rules. Use this to retrieve referenced urls (absolute urls) that were mentioned in previously fetched documentation.", paramsSchema: { url: z.string().describe("The URL of the document or page to fetch"), }, cb: async ({ url }) => { return fetchUrlContent({ url, env }); }, }, ]; }

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/idosal/git-mcp'

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