/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { statsGetMetricsSummary } from "../../funcs/statsGetMetricsSummary.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { currency: operations.Currency$inboundSchema, startDate: z.number().optional(), endDate: z.number().optional(), interval: operations.Interval$inboundSchema.optional(), }; export const tool$statsGetMetricsSummary: ToolDefinition = { name: "stats-get-metrics-summary", description: `Get store metrics summary Retrieve aggregated store metrics including counts, revenue, and MRR. When startDate and endDate are provided, totals are filtered to that date range. When interval is also provided, the response includes a periods array with time-series data points grouped by that interval. The periods array starts from the store's first transaction or startDate, whichever is later, to avoid empty leading buckets. All monetary amounts are in cents (integer, no decimals).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await statsGetMetricsSummary( client, args.currency, args.startDate, args.endDate, args.interval, { 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); }, };