Skip to main content
Glama

Plan Morpho Borrower Protection

morpho_protection

Calculate two alternative protection plans for one Base Morpho borrower under a selected collateral-price shock and target health factor: partial repayment or added collateral. Each plan includes the bounded asset amount, expected stressed health factor, evidence basis, and unsigned ERC-20 approval plus Morpho call templates. Use morpho_position for diagnosis without an action plan, morpho_market_underwrite for market-wide risk, or morpho_preliquidation_replay for a completed historical event. Read-only; no wallet, signing, broadcast, or custody. Payment challenge and credentials are bound to GET https://agents.samedaydesk.com/defi/morpho-protection, not mcp://. Retry the identical authorized arguments and credential.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesBorrower EVM address on Base mainnet.
executionBufferBpsNoAdditional repayment or collateral amount buffer in basis points for debt accrual and integer rounding; 25 means 0.25%.
targetHealthFactorNoTarget Morpho health factor after the selected collateral-price shock; must be greater than 1 and at most 5.
protectAgainstShockPctNoCollateral-price shock percentage to withstand, from -99 through 0; for example -10 models a 10% price decline.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
chainYes
inputsYes
quotesYes
sourceYes
addressYes
productYes
versionYes
boundaryYes
fetchedAtYes
invariantsYes
positionCountYes
actionableCountYes
latestIndexedAtYes
unverifiedCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "actionableCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "address": {
      +      "type": "string"
      +    },
      +    "boundary": {
      +      "type": "string"
      +    },
      +    "chain": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "id": {
      +          "type": "integer"
      +        },
      +        "name": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "name"
      +      ],
      +      "type": "object"
      +    },
      +    "fetchedAt": {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    "inputs": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "executionBufferBps": {
      +          "type": "integer"
      +        },
      +        "protectAgainstShockPct": {
      +          "type": "number"
      +        },
      +        "targetHealthFactor": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "targetHealthFactor",
      +        "protectAgainstShockPct",
      +        "executionBufferBps"
      +      ],
      +      "type": "object"
      +    },
      +    "invariants": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "broadcasting": {
      +          "const": "none",
      +          "type": "string"
      +        },
      +        "custody": {
      +          "const": "none",
      +          "type": "string"
      +        },
      +        "postconditions": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "revalidation": {
      +          "type": "string"
      +        },
      +        "signing": {
      +          "const": "none",
      +          "type": "string"
      +        },
      +        "simulation": {
      +          "type": "string"
      +        },
      +        "value": {
      +          "const": "0 on every unsigned transaction template",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "signing",
      +        "broadcasting",
      +        "custody",
      +        "value",
      +        "revalidation",
      +        "simulation",
      +        "postconditions"
      +      ],
      +      "type": "object"
      +    },
      +    "latestIndexedAt": {
      +      "anyOf": [
      +        {
      +          "format": "date-time",
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "ok": {
      +      "const": true,
      +      "type": "boolean"
      +    },
      +    "positionCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "product": {
      +      "const": "morpho-protection-quote",
      +      "type": "string"
      +    },
      +    "quotes": {
      +      "items": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "currentHealthFactor": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "explanation": {
      +                "type": "string"
      +              },
      +              "marketId": {
      +                "type": "string"
      +              },
      +              "plans": {
      +                "items": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "amount": {
      +                      "type": "string"
      +                    },
      +                    "amountRaw": {
      +                      "type": "string"
      +                    },
      +                    "asset": {
      +                      "additionalProperties": false,
      +                      "properties": {
      +                        "address": {
      +                          "type": [
      +                            "string",
      +                            "null"
      +                          ]
      +                        },
      +                        "decimals": {
      +                          "type": "number"
      +                        },
      +                        "symbol": {
      +                          "type": [
      +                            "string",
      +                            "null"
      +                          ]
      +                        }
      +                      },
      +                      "required": [
      +                        "address",
      +                        "symbol",
      +                        "decimals"
      +                      ],
      +                      "type": "object"
      +                    },
      +                    "expectedHealthFactorAtShock": {
      +                      "type": [
      +                        "number",
      +                        "null"
      +                      ]
      +                    },
      +                    "id": {
      +                      "enum": [
      +                        "partial_repay",
      +                        "add_collateral"
      +                      ],
      +                      "type": "string"
      +                    },
      +                    "transactions": {
      +                      "items": {
      +                        "additionalProperties": false,
      +                        "properties": {
      +                          "data": {
      +                            "pattern": "^0x[0-9a-fA-F]+$",
      +                            "type": "string"
      +                          },
      +                          "purpose": {
      +                            "type": "string"
      +                          },
      +                          "to": {
      +                            "type": "string"
      +                          },
      +                          "value": {
      +                            "const": "0",
      +                            "type": "string"
      +                          }
      +                        },
      +                        "required": [
      +                          "to",
      +                          "value",
      +                          "data",
      +                          "purpose"
      +                        ],
      +                        "type": "object"
      +                      },
      +                      "maxItems": 2,
      +                      "minItems": 2,
      +                      "type": "array"
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "asset",
      +                    "amountRaw",
      +                    "amount",
      +                    "expectedHealthFactorAtShock",
      +                    "transactions"
      +                  ],
      +                  "type": "object"
      +                },
      +                "maxItems": 0,
      +                "type": "array"
      +              },
      +              "status": {
      +                "const": "state_unverified",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "marketId",
      +              "currentHealthFactor",
      +              "status",
      +              "plans",
      +              "explanation"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "currentHealthFactor": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "explanation": {
      +                "type": "string"
      +              },
      +              "healthFactorAtShockBeforeAction": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "marketId": {
      +                "type": "string"
      +              },
      +              "plans": {
      +                "items": {
      +                  "$ref": "#/properties/quotes/items/anyOf/0/properties/plans/items"
      +                },
      +                "maxItems": 0,
      +                "type": "array"
      +              },
      +              "shock": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "collateralPricePct": {
      +                    "type": "number"
      +                  },
      +                  "oraclePriceRaw": {
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "collateralPricePct",
      +                  "oraclePriceRaw"
      +                ],
      +                "type": "object"
      +              },
      +              "stateBasis": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "blockNumber": {
      +                    "anyOf": [
      +                      {
      +                        "type": "integer"
      +                      },
      +                      {
      +                        "type": "null"
      +                      }
      +                    ]
      +                  },
      +                  "borrowAssets": {
      +                    "const": "indexed amount with explicit execution buffer",
      +                    "type": "string"
      +                  },
      +                  "collateralAndBorrowShares": {
      +                    "const": "direct_rpc_exact_match",
      +                    "type": "string"
      +                  },
      +                  "marketParams": {
      +                    "const": "keccak256 match to observed Morpho market ID",
      +                    "type": "string"
      +                  },
      +                  "oraclePrice": {
      +                    "const": "direct_rpc_fresh_read",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "blockNumber",
      +                  "collateralAndBorrowShares",
      +                  "oraclePrice",
      +                  "borrowAssets",
      +                  "marketParams"
      +                ],
      +                "type": "object"
      +              },
      +              "status": {
      +                "const": "target_met",
      +                "type": "string"
      +              },
      +              "targetHealthFactorAtShock": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "marketId",
      +              "currentHealthFactor",
      +              "healthFactorAtShockBeforeAction",
      +              "targetHealthFactorAtShock",
      +              "shock",
      +              "stateBasis",
      +              "status",
      +              "plans",
      +              "explanation"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "currentHealthFactor": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/currentHealthFactor"
      +              },
      +              "healthFactorAtShockBeforeAction": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/healthFactorAtShockBeforeAction"
      +              },
      +              "marketId": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/marketId"
      +              },
      +              "plans": {
      +                "items": {
      +                  "$ref": "#/properties/quotes/items/anyOf/0/properties/plans/items"
      +                },
      +                "maxItems": 2,
      +                "minItems": 2,
      +                "type": "array"
      +              },
      +              "shock": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/shock"
      +              },
      +              "stateBasis": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/stateBasis"
      +              },
      +              "status": {
      +                "const": "protection_available",
      +                "type": "string"
      +              },
      +              "targetHealthFactorAtShock": {
      +                "$ref": "#/properties/quotes/items/anyOf/1/properties/targetHealthFactorAtShock"
      +              }
      +            },
      +            "required": [
      +              "marketId",
      +              "currentHealthFactor",
      +              "healthFactorAtShockBeforeAction",
      +              "targetHealthFactorAtShock",
      +              "shock",
      +              "stateBasis",
      +              "status",
      +              "plans"
      +            ],
      +            "type": "object"
      +          }
      +        ]
      +      },
      +      "type": "array"
      +    },
      +    "source": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "provider": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "provider"
      +      ],
      +      "type": "object"
      +    },
      +    "unverifiedCount": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "version": {
      +      "const": "1.0.0",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "product",
      +    "version",
      +    "address",
      +    "chain",
      +    "fetchedAt",
      +    "latestIndexedAt",
      +    "inputs",
      +    "positionCount",
      +    "actionableCount",
      +    "unverifiedCount",
      +    "quotes",
      +    "source",
      +    "invariants",
      +    "boundary"
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • changedInput schema / properties / address / description
      Previous value: -"Borrower EVM address on Base mainnet"New value: +"Borrower EVM address on Base mainnet."
    • addedInput schema / properties / executionBufferBps / description
      Added value: +"Additional repayment or collateral amount buffer in basis points for debt accrual and integer rounding; 25 means 0.25%."
    • addedInput schema / properties / protectAgainstShockPct / description
      Added value: +"Collateral-price shock percentage to withstand, from -99 through 0; for example -10 models a 10% price decline."
    • addedInput schema / properties / targetHealthFactor / description
      Added value: +"Target Morpho health factor after the selected collateral-price shock; must be greater than 1 and at most 5."
  3. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.