/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { institutionsSearchInstitutions } from "../../funcs/institutionsSearchInstitutions.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.SearchInstitutionsRequest$inboundSchema, }; export const tool$institutionsSearchInstitutions: ToolDefinition = { name: "institutions-search-institutions", description: `Search for financial institutions by name or routing number. This endpoint returns metadata about each matched institution, including basic identifying details (such as name, routing number, and address) and information about which payment services they support (e.g., ACH, RTP, and Wire). This can be used to validate a financial institution before initiating payment activity, or to check which payment rails are available for a given routing number. To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the \`/institutions.read\` scope.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await institutionsSearchInstitutions( 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); }, };