/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { agentVersionsRollbackAgentVersion } from "../../funcs/agentVersionsRollbackAgentVersion.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.RollbackAgentVersionRequest$inboundSchema, }; export const tool$agentVersionsRollbackAgentVersion: ToolDefinition< typeof args > = { name: "agent-versions-rollback-agent-version", description: `Roll back an agent to a version Restores the target version's configuration as a new current version. History is preserved: the restore is appended as a new version rather than deleting later ones.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await agentVersionsRollbackAgentVersion( 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); }, };