Skip to main content
Glama

Dodo Payments

Official
by dodopayments
code-tool-worker.ts1.19 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import util from 'node:util'; import { WorkerInput, WorkerSuccess, WorkerError } from './code-tool-types'; import { DodoPayments } from 'dodopayments'; const fetch = async (req: Request): Promise<Response> => { const { opts, code } = (await req.json()) as WorkerInput; const client = new DodoPayments({ ...opts, }); const logLines: string[] = []; const errLines: string[] = []; const console = { log: (...args: unknown[]) => { logLines.push(util.format(...args)); }, error: (...args: unknown[]) => { errLines.push(util.format(...args)); }, }; try { let run_ = async (client: any) => {}; eval(` ${code} run_ = run; `); const result = await run_(client); return Response.json({ result, logLines, errLines, } satisfies WorkerSuccess); } catch (e) { const message = e instanceof Error ? e.message : undefined; return Response.json( { message, } satisfies WorkerError, { status: 400, statusText: 'Code execution error' }, ); } }; export default { fetch };

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/dodopayments/dodopayments-node'

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