UNPKG

@opra-app/mcp

Version:

MCP server for OPRA's business and discount data

19 lines (18 loc) 577 B
import { listCampaigns } from "../api.js"; export const registerListCampaignsTool = (server) => { server.tool("list-campaigns", "Lists all campaigns", {}, async () => { try { const campaigns = await listCampaigns(); return { content: [{ type: "text", text: JSON.stringify(campaigns) }], }; } catch (error) { return { content: [ { type: "text", text: `Failed to retrieve campaigns: ${error}` }, ], }; } }); };