/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { metricsGetAttemptMetrics } from "../../funcs/metricsGetAttemptMetrics.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetAttemptMetricsRequest$inboundSchema, }; export const tool$metricsGetAttemptMetrics: ToolDefinition = { name: "metrics-get-attempt-metrics", description: `Get Attempt Metrics Returns aggregated delivery attempt metrics. Supports time bucketing via granularity, dimensional grouping, and filtering. **Measures:** \`count\`, \`successful_count\`, \`failed_count\`, \`error_rate\`, \`first_attempt_count\`, \`retry_count\`, \`manual_retry_count\`, \`avg_attempt_number\`, \`rate\`, \`successful_rate\`, \`failed_rate\` **Dimensions:** \`tenant_id\` (admin-only), \`destination_id\`, \`topic\`, \`status\`, \`code\`, \`manual\`, \`attempt_number\` **Filters:** \`tenant_id\` (admin-only), \`destination_id\`, \`topic\`, \`status\`, \`code\`, \`manual\`, \`attempt_number\` `, args, tool: async (client, args, ctx) => { const [result, apiCall] = await metricsGetAttemptMetrics( 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); }, };