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

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

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

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: it declares read-only operation and explicitly excludes wallet, signing, broadcast, and custody. It also discloses the outputs included (bounded asset amount, stressed health factor, evidence basis, unsigned approval/call templates) and the payment/credential mechanism with the retry instruction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose and the alternative routing before the operational details. Mostly efficient, though the payment-challenge/credential sentence is dense and slightly tangential for a tool-selection reader.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only planning tool with a full output schema, no annotations, and 100% schema coverage, the description is complete: it covers purpose, alternative selection, safety profile, and output contents. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents address, executionBufferBps, targetHealthFactor, and protectAgainstShockPct thoroughly. The description references the shock and target health factor conceptually but adds no format or unit detail beyond what the schema provides; baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Calculate') and resource ('two alternative protection plans for one Base Morpho borrower') with the exact scope (partial repayment vs added collateral, one shock, one target health factor). It names and distinguishes each relevant sibling, so an agent can tell it apart from morpho_position, morpho_market_underwrite, and morpho_preliquidation_replay without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent to alternatives with the condition that selects each: morpho_position for diagnosis without an action plan, morpho_market_underwrite for market-wide risk, morpho_preliquidation_replay for a completed historical event. Leaves nothing to inference about when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.