Skip to main content
Glama

Cyberlink MCP Server

by dasein108
utils.ts1.17 kB
/** * Sanitizes query results by converting BigInt to string and handling undefined values * @param obj Any query result object * @returns Sanitized object */ export const sanitizeQueryResult = (obj: any): any => { if (obj === null || obj === undefined) return obj; if (typeof obj === 'bigint') return obj.toString(); if (typeof obj === 'function') return undefined; if (Array.isArray(obj)) return obj.map(sanitizeQueryResult); if (typeof obj === 'object' && obj !== null) { const newObj: Record<string, any> = {}; for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { const sanitizedValue = sanitizeQueryResult(obj[key]); if (sanitizedValue !== undefined) { newObj[key] = sanitizedValue; } } } return newObj; } return obj; }; export function removeEmptyValues<T extends Record<string, any>>(obj: T): T { const filtered = Object.fromEntries( Object.entries(obj).filter(([_, value]) => value != null && value !== '') ); return filtered as T; } export function stringifyValue(value: any | undefined) { return value ? JSON.stringify(value) : undefined; }

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/dasein108/mcp-cw-graph'

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