/**
* If the incoming function returns a promise, return the promise.
* Otherwise, return a promise that resolves to the incoming function's return value.
*/
export function promisifyResult<T>(result: T) {
if (result instanceof Promise) {
return result as T extends Promise<infer U> ? Promise<U> : never;
}
return Promise.resolve(result) as T extends Promise<unknown>
? never
: Promise<T>;
}
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/Arize-ai/phoenix'
If you have feedback or need assistance with the MCP directory API, please join our Discord server