/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { checkoutsRetrieve } from "../../funcs/checkoutsRetrieve.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { checkoutId: z.string(), }; export const tool$checkoutsRetrieve: ToolDefinition = { name: "checkouts-retrieve", description: `Retrieve a checkout session. Retrieve details of a checkout session by ID. View status, customer info, and payment details.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await checkoutsRetrieve( client, args.checkoutId, { 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); }, };