Skip to main content
Glama
IndigoProtocol

IndigoProtocol/indigo-mcp

Official

adjust_rob

Modify ADA amounts in an ROB position on Cardano by increasing or decreasing collateral, with optional price limit updates, and generate unsigned transactions for signing.

Instructions

Adjust ADA amount in an ROB position (positive to increase, negative to decrease). Optionally update the max price. Returns an unsigned transaction (CBOR hex) for client-side signing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesUser Cardano bech32 address
robTxHashYesTransaction hash of the ROB UTxO
robOutputIndexYesOutput index of the ROB UTxO
lovelacesAdjustAmountYesLovelace adjustment amount (positive to add, negative to remove)
newMaxPriceNoOptional new max price as an on-chain integer string

Implementation Reference

  • The async handler function for the adjust_rob tool, which builds the unsigned transaction by calling adjustLrp.
    async ({ address, robTxHash, robOutputIndex, lovelacesAdjustAmount, newMaxPrice }) => {
      try {
        const result = await buildUnsignedTx(
          address,
          async (lucid) => {
            const params = await getSystemParams();
            const robOutRef = { txHash: robTxHash, outputIndex: robOutputIndex };
            const newMaxPriceDecimal =
              newMaxPrice !== undefined ? parseMaxPrice(newMaxPrice) : undefined;
            return adjustLrp(
              lucid,
              robOutRef,
              BigInt(lovelacesAdjustAmount),
              newMaxPriceDecimal,
              params
            );
          },
  • Zod schema definition for the adjust_rob tool input parameters.
    {
      address: z.string().describe('User Cardano bech32 address'),
      robTxHash: z.string().describe('Transaction hash of the ROB UTxO'),
      robOutputIndex: z.number().describe('Output index of the ROB UTxO'),
      lovelacesAdjustAmount: z
        .string()
        .describe('Lovelace adjustment amount (positive to add, negative to remove)'),
      newMaxPrice: z
        .string()
        .optional()
        .describe('Optional new max price as an on-chain integer string'),
    },
  • Tool registration for adjust_rob within the server instance.
    server.tool(
      'adjust_rob',
      'Adjust ADA amount in an ROB position (positive to increase, negative to decrease). Optionally update the max price. Returns an unsigned transaction (CBOR hex) for client-side signing.',
      {
        address: z.string().describe('User Cardano bech32 address'),
        robTxHash: z.string().describe('Transaction hash of the ROB UTxO'),
        robOutputIndex: z.number().describe('Output index of the ROB UTxO'),
        lovelacesAdjustAmount: z
          .string()
          .describe('Lovelace adjustment amount (positive to add, negative to remove)'),
        newMaxPrice: z
          .string()
          .optional()
          .describe('Optional new max price as an on-chain integer string'),
      },
      async ({ address, robTxHash, robOutputIndex, lovelacesAdjustAmount, newMaxPrice }) => {
        try {
          const result = await buildUnsignedTx(
            address,
            async (lucid) => {
              const params = await getSystemParams();
              const robOutRef = { txHash: robTxHash, outputIndex: robOutputIndex };
              const newMaxPriceDecimal =
                newMaxPrice !== undefined ? parseMaxPrice(newMaxPrice) : undefined;
              return adjustLrp(
                lucid,
                robOutRef,
                BigInt(lovelacesAdjustAmount),
                newMaxPriceDecimal,
                params
              );
            },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IndigoProtocol/indigo-protocolindigo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server