/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { budgetsSetTeam } from "../../funcs/budgetsSetTeam.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.SetTeamBudgetRequest$inboundSchema, }; export const tool$budgetsSetTeam: ToolDefinition = { name: "budgets-set-team", description: `Set a team budget Creates or updates a budget for the team in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit team budget replaces the org's per-team default budget of the same owner and period for this team (exemption-by-override — it may raise or tighten it); different-period defaults, org budgets, and API-key budgets still apply. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for teams in their own organization (owner=org).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await budgetsSetTeam( 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); }, };