Skip to main content
Glama
api.ts832 B
export const API_BASE_URL = "https://api.capacities.io"; export function getApiKey(): string { const apiKey = process.env.CAPACITIES_API_KEY; if (!apiKey) { throw new Error("CAPACITIES_API_KEY environment variable is required"); } return apiKey; } export async function makeApiRequest( endpoint: string, options: RequestInit = {}, ): Promise<Response> { const apiKey = getApiKey(); const requestOptions = { ...options, headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", ...options.headers, }, }; const response = await fetch(`${API_BASE_URL}${endpoint}`, requestOptions); if (!response.ok) { const errorText = await response.text(); throw new Error( `Capacities API error: ${response.status} ${response.statusText} - ${errorText}`, ); } return response; }

Implementation Reference

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/Im-Hal-9K/Capacities-MCP-Plus'

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