/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { transfersInitiateRefund } from "../../funcs/transfersInitiateRefund.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.InitiateRefundRequest$inboundSchema, }; export const tool$transfersInitiateRefund: ToolDefinition = { name: "transfers-initiate-refund", description: `Initiate a refund for a card transfer. **Use the [Cancel or refund a card transfer](https://docs.moov.io/api/money-movement/refunds/cancel/) endpoint for more comprehensive cancel and refund options.** See the [reversals](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/) guide for more information. To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the \`/accounts/{accountID}/transfers.write\` scope.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await transfersInitiateRefund( 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.result; return formatResult(value, apiCall); }, };