{
  "name": "OnFRA — Onfra Financial Intelligence Agent",
  "version": "2026-06-08",
  "description": "MCP discovery for OnFRA on Onfra. Analyzes Celo wallet activity into financial health, reputation, income stability, portfolio risk, loan capacity, and Verified Financial Reputation Reports. Query any wallet at https://app.onfra.xyz.",
  "auth": {
    "scheme": "x402",
    "model": "pay-per-request",
    "apiKeyRequired": false,
    "chain": "celo",
    "network": "celo",
    "chainId": 42220,
    "currency": "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
    "currencySymbol": "USDT",
    "paymentHeader": "X-PAYMENT",
    "alternateHeaders": ["PAYMENT-SIGNATURE", "x-payment"],
    "configUrl": "https://app.onfra.xyz/api/x402/config",
    "healthUrl": "https://app.onfra.xyz/api/health/integrations",
    "capabilitiesUrl": "https://app.onfra.xyz/api/capabilities",
    "pricing": {
      "own_wallet_dashboard_query": "free",
      "external_wallet_query": "0.01 USDT",
      "verified_financial_reputation_report": "0.10 USDT",
      "cached_signal_read": "free",
      "verify_report": "free"
    },
    "paymentRequired": {
      "httpStatus": 402,
      "code": "PAYMENT_REQUIRED",
      "bodyFields": [
        "payTo",
        "asset",
        "priceUsdt",
        "maxAmountRequired",
        "network",
        "chainId",
        "paymentHeader",
        "accepts",
        "retry"
      ],
      "example": {
        "error": "Payment Required",
        "code": "PAYMENT_REQUIRED",
        "scheme": "x402",
        "network": "celo",
        "chainId": 42220,
        "asset": "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
        "currencySymbol": "USDT",
        "priceUsdt": "0.01",
        "maxAmountRequired": "10000",
        "payTo": "<from /api/x402/config>",
        "paymentHeader": "X-PAYMENT",
        "accepts": [
          {
            "scheme": "x402",
            "network": "celo",
            "chainId": 42220,
            "maxAmountRequired": "10000",
            "asset": "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
            "payTo": "<treasury>"
          }
        ],
        "retry": {
          "method": "resubmit",
          "header": "X-PAYMENT",
          "steps": [
            "Read accepts[0] (asset, maxAmountRequired, payTo, network).",
            "Sign EIP-3009 USDT authorization for maxAmountRequired to payTo.",
            "Retry the same HTTP request with X-PAYMENT set to the payment payload."
          ]
        }
      }
    }
  },
  "signals": {
    "ids": [
      "monthly-income",
      "financial-health",
      "reputation-score",
      "loan-capacity",
      "statement",
      "assessment"
    ],
    "listPath": "/api/wallet/{address}/signals",
    "readPath": "/api/wallet/{address}/signals/{signal}",
    "pricing": "free from cache after analyze"
  },
  "onChainActions": [
    "USDT x402 settlement to payTo on Celo",
    "OnchainReporter.publishFinancialReport for REP passports",
    "OnchainReporter.verifyReport / GET /api/agent/verify/{id}",
    "ERC-8004 agent #9219 identity"
  ],
  "tools": [
    {
      "name": "analyze_wallet",
      "description": "Analyze any Celo wallet. Returns health, reputation, income, loan capacity, and AI summary. Agent/API calls cost 0.01 USDT via x402; unpaid calls return HTTP 402 with accepts[].",
      "inputSchema": {
        "type": "object",
        "required": ["walletAddress"],
        "properties": {
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "description": "EVM wallet address to analyze (Celo-first)."
          },
          "months": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "default": 3,
            "description": "Months of transaction history for cash-flow statement."
          },
          "includeAttestation": {
            "type": "boolean",
            "default": true
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "monthlyIncome",
                "financialHealth",
                "reputationScore",
                "loanCapacity",
                "statement",
                "assessment",
                "walletData"
              ]
            },
            "description": "Optional subset of fields instead of full walletData."
          },
          "force": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "inputSchemaUrl": "https://app.onfra.xyz/schemas/walletAnalysisRequest.schema.json",
      "outputSchemaUrl": "https://app.onfra.xyz/schemas/walletAnalysisResult.schema.json",
      "priceUsdt": "0.01",
      "route": { "method": "POST", "path": "/api/agent/analyze" }
    },
    {
      "name": "get_wallet_signal",
      "description": "Read one reputation signal from cached analysis (free). Signal ids: monthly-income, financial-health, reputation-score, loan-capacity, statement, assessment. Returns 404 with hint to analyze_wallet if cache is missing.",
      "inputSchema": {
        "type": "object",
        "required": ["walletAddress", "signal"],
        "properties": {
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$"
          },
          "signal": {
            "type": "string",
            "enum": [
              "monthly-income",
              "financial-health",
              "reputation-score",
              "loan-capacity",
              "statement",
              "assessment"
            ]
          }
        }
      },
      "outputSchemaUrl": "https://app.onfra.xyz/schemas/walletSignalResult.schema.json",
      "priceUsdt": "0",
      "route": { "method": "GET", "path": "/api/wallet/{address}/signals/{signal}" }
    },
    {
      "name": "chat_query",
      "description": "Natural-language query about any wallet's financial health, reputation, income stability, portfolio risk, or loan capacity. Costs 0.01 USDT via x402 when enforcement is enabled.",
      "inputSchema": {
        "type": "object",
        "required": ["message"],
        "properties": {
          "message": {
            "type": "string",
            "description": "Question about a wallet's financial reputation."
          },
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "description": "Target wallet. Required for external wallet queries."
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": { "type": "string", "enum": ["user", "assistant", "system"] },
                "content": { "type": "string" }
              }
            }
          }
        }
      },
      "inputSchemaUrl": "https://app.onfra.xyz/schemas/chatRequest.schema.json",
      "priceUsdt": "0.01",
      "route": { "method": "POST", "path": "/api/agent/chat" }
    },
    {
      "name": "screen_wallet",
      "description": "Lender underwriting screen for a borrower wallet. Returns trustworthiness, reputation, income estimate, and loan capacity. Costs 0.01 USDT via x402.",
      "inputSchema": {
        "type": "object",
        "required": ["walletAddress"],
        "properties": {
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "description": "Borrower wallet to screen."
          },
          "force": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "inputSchemaUrl": "https://app.onfra.xyz/schemas/lenderScreenRequest.schema.json",
      "outputSchemaUrl": "https://app.onfra.xyz/schemas/lenderScreenResult.schema.json",
      "priceUsdt": "0.01",
      "route": { "method": "POST", "path": "/api/lender/screen" }
    },
    {
      "name": "generate_statement",
      "description": "Generate a transaction statement PDF, pin to IPFS. period must be 3M, 6M, or 12M. Costs 0.01 USDT via x402.",
      "inputSchema": {
        "type": "object",
        "required": ["walletAddress"],
        "properties": {
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$"
          },
          "period": {
            "type": "string",
            "enum": ["3M", "6M", "12M"],
            "default": "3M",
            "description": "Statement lookback period."
          },
          "force": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "inputSchemaUrl": "https://app.onfra.xyz/schemas/statementRequest.schema.json",
      "priceUsdt": "0.01",
      "route": { "method": "POST", "path": "/api/agent/statement" }
    },
    {
      "name": "generate_report",
      "description": "Purchase a Verified Financial Reputation Report with scores, AI summary, verification code, and onchain OnchainReporter attestation. Costs 0.10 USDT via x402.",
      "inputSchema": {
        "type": "object",
        "required": ["walletAddress"],
        "properties": {
          "walletAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$"
          },
          "periodMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "default": 3,
            "description": "Statement period: 3, 6, or 12 months."
          }
        }
      },
      "inputSchemaUrl": "https://app.onfra.xyz/schemas/reportRequest.schema.json",
      "outputSchemaUrl": "https://app.onfra.xyz/schemas/reportResult.schema.json",
      "priceUsdt": "0.10",
      "route": { "method": "POST", "path": "/api/agent/report" },
      "onChain": true
    },
    {
      "name": "verify_report",
      "description": "Confirm a Verified Financial Reputation Report verification code (WP-...) or report ID (REP-...) was issued by OnFRA and attested onchain (free).",
      "inputSchema": {
        "type": "object",
        "required": ["reportId"],
        "properties": {
          "reportId": {
            "type": "string",
            "description": "Report ID (REP-...) or verification code (WP-...)."
          }
        }
      },
      "priceUsdt": "0",
      "route": { "method": "GET", "path": "/api/agent/verify/{reportId}" },
      "onChain": true
    }
  ],
  "prompts": [
    { "name": "financial_health", "description": "What is the Financial Health Score for this wallet?" },
    { "name": "reputation_check", "description": "What is this wallet's reputation and trust rating?" },
    { "name": "income_stability", "description": "Is this wallet a stable earner? What is the income classification?" },
    { "name": "portfolio_risk", "description": "What is the portfolio risk exposure for this wallet?" },
    { "name": "loan_capacity", "description": "How much can this wallet safely borrow?" },
    { "name": "verified_report", "description": "Generate a Verified Financial Reputation Report for lending." }
  ],
  "resources": [
    {
      "uri": "https://app.onfra.xyz/api/capabilities",
      "name": "Capabilities (actions, pricing, on-chain)"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/lenderScreenRequest.schema.json",
      "name": "Lender Screen Request Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/lenderScreenResult.schema.json",
      "name": "Lender Screen Result Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/walletAnalysisRequest.schema.json",
      "name": "Wallet Analysis Request Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/walletAnalysisResult.schema.json",
      "name": "Wallet Analysis Result Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/walletSignalResult.schema.json",
      "name": "Wallet Signal Result Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/chatRequest.schema.json",
      "name": "Chat Request Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/statementRequest.schema.json",
      "name": "Statement Request Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/reportRequest.schema.json",
      "name": "Report Request Schema"
    },
    {
      "uri": "https://app.onfra.xyz/schemas/reportResult.schema.json",
      "name": "Report Result Schema"
    }
  ],
  "examples": [
    {
      "prompt": "Analyze this Celo wallet for microfinance lending eligibility",
      "tool": "analyze_wallet",
      "input": {
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315",
        "months": 3
      }
    },
    {
      "prompt": "Read loan capacity from cache",
      "tool": "get_wallet_signal",
      "input": {
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315",
        "signal": "loan-capacity"
      }
    },
    {
      "prompt": "Can this freelancer wallet prove stable income?",
      "tool": "chat_query",
      "input": {
        "message": "What is the income stability classification and monthly inflow estimate?",
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315"
      }
    },
    {
      "prompt": "Should we approve this borrower wallet for a microloan?",
      "tool": "screen_wallet",
      "input": {
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315"
      }
    },
    {
      "prompt": "Generate a 6-month statement",
      "tool": "generate_statement",
      "input": {
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315",
        "period": "6M"
      }
    },
    {
      "prompt": "Purchase a Verified Financial Reputation Report for a loan application",
      "tool": "generate_report",
      "input": {
        "walletAddress": "0x4821ced48fb4456055c86e42587f61c1f39c6315",
        "periodMonths": 3
      }
    }
  ],
  "integration": {
    "note": "OnFRA lender infrastructure: https://app.onfra.xyz/developers · Capabilities: GET /api/capabilities · Health (payTo): GET /api/health/integrations · Docs: https://onfra.xyz/docs · Skill: npx skills add jeffIshmael/onfra-skill",
    "routes": {
      "screen_wallet": { "method": "POST", "path": "/api/lender/screen" },
      "analyze_wallet": { "method": "POST", "path": "/api/agent/analyze" },
      "get_wallet_signal": { "method": "GET", "path": "/api/wallet/{address}/signals/{signal}" },
      "chat_query": { "method": "POST", "path": "/api/agent/chat" },
      "generate_statement": { "method": "POST", "path": "/api/agent/statement" },
      "generate_report": { "method": "POST", "path": "/api/agent/report" },
      "verify_report": { "method": "GET", "path": "/api/agent/verify/{reportId}" }
    }
  }
}
