Skip to main content
Glama
encodeJsonIntoLinkParameters.ts687 B
import Client from "../../Client/index.js"; import isString from 'lodash/isString.js'; type Error = { message?: string; data?: { [name: string]: string }; }; export interface CodeInfo { code: string; description?: string; descriptionEn?: string; } export default async function encodeJsonIntoLinkParameters( agent: Client, json: any, ) { try { let input = json; if (input && !isString(input)) { try { input = JSON.stringify(input); } catch (e) { console.error(e); } } return input ? encodeURIComponent(input) : ''; } catch (error: any) { throw new Error(`encodeJsonIntoLinkParameters failed: ${error.message}`); } }

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/datafe/quick-chart-mcp'

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