export type CreateApiV1ToolsToolIdDisableArgs = {tool_id: string}; export type CreateApiV1ToolsToolIdDisableOptions = {baseUrl: string, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable an API tool * * POST /v1/tools/{tool_id}/disable */ export const createApiV1ToolsToolIdDisable = async (args: CreateApiV1ToolsToolIdDisableArgs, options: CreateApiV1ToolsToolIdDisableOptions) => { const {baseUrl, fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("x-api-key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/tools/${encodeURIComponent(String(args.tool_id))}/disable${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };