/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { discountsGet } from "../../funcs/discountsGet.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { discountId: z.string().optional(), discountCode: z.string().optional(), }; export const tool$discountsGet: ToolDefinition = { name: "discounts-get", description: `Retrieve discount Retrieve discount code details by ID or code. Check usage limits, expiration, and discount amount.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await discountsGet( client, args.discountId, args.discountCode, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };