/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { usageSandbox } from "../../funcs/usageSandbox.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetSandboxUsageRequest$inboundSchema, }; export const tool$usageSandbox: ToolDefinition = { name: "usage-sandbox", description: `Get Sandbox Usage Aggregate sandbox usage (session lifecycle, execution, and workspace operations) over a time range, bucketed and optionally grouped. Buckets are calendar-aligned in UTC: \`start_time\` is snapped down and \`end_time\` snapped up to the nearest bucket-width boundary, so the first and last buckets may extend slightly beyond the requested range. Org-scoped: callers see their own usage, org admins their team's; cluster admins may pass \`all_orgs\` or \`org_ids\`. Cost and spend reporting lives in the budgeting API (\`/api/v1/budgeting/usage/costs\`).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await usageSandbox( 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); }, };