UNPKG

@opra-app/mcp

Version:

MCP server for OPRA's business and discount data

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