/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { supplyGet } from "../../funcs/supplyGet.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetSupplyRequest$inboundSchema, }; export const tool$supplyGet: ToolDefinition = { name: "supply-get", description: `Get supply data for a commodity and country Returns historical and forecasted supply data for a given commodity and country. Country codes follow the UN/LOCODE standard: https://unece.org/trade/cefact/unlocode-code-list-country-and-territory`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await supplyGet( client, args.request, { 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); }, };