/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { productsSearch } from "../../funcs/productsSearch.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { pageNumber: z.number().default(1), pageSize: z.number().default(10), }; export const tool$productsSearch: ToolDefinition = { name: "products-search", description: `List all products Search and retrieve a paginated list of products. Filter by status, billing type, and other criteria.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await productsSearch( client, args.pageNumber, args.pageSize, { 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); }, };