/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { budgetsSetUser } from "../../funcs/budgetsSetUser.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.SetUserBudgetRequest$inboundSchema, }; export const tool$budgetsSetUser: ToolDefinition = { name: "budgets-set-user", description: `Set a user budget Creates or updates a budget for the user in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit user budget replaces the org's per-user default budget of the same owner and period for this user (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 users in their own organization (owner=org).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await budgetsSetUser( 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); }, };