Skip to main content
Glama
Json.js563 B
import { Logger } from "./Logger.js"; export const obj2String = (obj, format = false) => { let json = ""; try { if (format) { json = JSON.stringify(obj, null, " "); } else { json = JSON.stringify(obj); } } catch (error) { Logger.error(error); } return json; }; export const string2Obj = (json) => { if (json) { try { return JSON.parse(json); } catch (error) { Logger.error(error); } } return undefined; };

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/Yuki4-dev/grpc-mcp'

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