/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { metricsGetEventMetrics } from "../../funcs/metricsGetEventMetrics.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetEventMetricsRequest$inboundSchema, }; export const tool$metricsGetEventMetrics: ToolDefinition = { name: "metrics-get-event-metrics", description: `Get Event Metrics Returns aggregated event publish metrics. Supports time bucketing via granularity, dimensional grouping, and filtering. **Measures:** \`count\`, \`rate\` **Dimensions:** \`tenant_id\` (admin-only), \`topic\`, \`destination_id\` **Filters:** \`tenant_id\` (admin-only), \`topic\`, \`destination_id\` `, args, tool: async (client, args, ctx) => { const [result, apiCall] = await metricsGetEventMetrics( 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); }, };