Skip to main content
Glama

MCP Agent TypeScript Port

by waldzellai
maybe-async-result.js496 B
import { isPromise } from './is-promise.js'; export function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => { throw err; }) { try { const result = isFunction(getResult) ? getResult() : getResult; return isPromise(result) ? result.then((result) => resultHandler(result)) : resultHandler(result); } catch (err) { return errorHandler(err); } } function isFunction(arg) { return typeof arg === 'function'; }

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/waldzellai/mcp-agent-ts'

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