Skip to main content
Glama
getEndpointProperties.jsโ€ข1.1 kB
import { EndpointError } from "../types"; import { evaluateTemplate } from "./evaluateTemplate"; export const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ ...acc, [propertyKey]: group.getEndpointProperty(propertyVal, options), }), {}); export const getEndpointProperty = (property, options) => { if (Array.isArray(property)) { return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); } switch (typeof property) { case "string": return evaluateTemplate(property, options); case "object": if (property === null) { throw new EndpointError(`Unexpected endpoint property: ${property}`); } return group.getEndpointProperties(property, options); case "boolean": return property; default: throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); } }; export const group = { getEndpointProperty, getEndpointProperties, };

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/consigcody94/office-whisperer'

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