Skip to main content
Glama
growsurf

GrowSurf MCP Server

Official

growsurf_refund_transaction

DestructiveIdempotent

Record a refund, partial refund, or chargeback to reverse or adjust an affiliate commission on a previously recorded transaction.

Instructions

Record an amendment (refund, partial refund, or chargeback) against a previously recorded affiliate transaction; reverses or adjusts the referrer's commission. The inverse of growsurf_record_sale. Identify the original transaction with the same identifier you sent when recording it (omit amountRefunded for a full refund). Already-paid commissions are not clawed back (recorded for tax only). Targets campaignId if you pass it, otherwise GROWSURF_CAMPAIGN_ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNo
orderIdNo
chargeIdNo
currencyNo
refundIdNoStable per-refund identifier. Required when canceling a refund or changing the refunded total after a cancellation. Reuse the original refund's identifier for its cancellation. An amendment without enough refund identity returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation.
testModeNoOriginal payment mode: `true` for test or `false` for live. Requires `paymentProvider`.
invoiceIdNo
paymentIdNo
campaignIdNoTarget program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Pass the `id` returned by growsurf_create_campaign to configure or operate a program you just created, without restarting the server.
externalIdNo
descriptionNo
refundAmountNoPositive amount for this individual refund, no greater than the sale amount, in the sale currency's minor unit. Send it with `refundId` on each original refund to support cancellations and out-of-order amendments. The amount for a given `refundId` cannot change. A cancellation can omit it when the original amount is already recorded. Incomplete refund history returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation.
refundStatusNo
amendmentTypeNo
participantIdNo
transactionIdNo
amountRefundedNo
paymentIntentIdNo
paymentProviderNoConnected provider for the original payment. Requires its `transactionId` and `testMode`. This amends GrowSurf records without sending a refund through the provider.
participantEmailNo
refundHistoryCompleteNoSet true only after reconciling and recording every original refundId and refundAmount, including refunds later canceled. This confirmation resolves previously incomplete history. Omit during ordinary delivery. Replaying an old confirmation cannot resolve a later gap; confirm a newly reconciled refund or complete provider list.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletedNoPending commissions deleted by the amendment.
matchedNoCommissions found for the provided identifiers.
messageNoHuman-readable result message.
successNo`true` when the amendment was processed; `false` when no matching transaction was found.
adjustedNoCommissions partially adjusted.
notFoundNoPresent and `true` when no commission matched the provided identifiers.
reversedNoCommissions reversed (set to zero amount).
amendmentTypeNoAmendment type that was processed.
matchingCommissionIdsNoCommission ids that matched the submitted identifiers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.14.0
    • changedInput schema / allOf
      Previous value: -[
      -  {
      -    "anyOf": [
      -      {
      -        "required": [
      -          "participantId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "participantEmail"
      -        ]
      -      }
      -    ]
      -  },
      -  {
      -    "anyOf": [
      -      {
      -        "required": [
      -          "externalId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "transactionId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "orderId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "paymentId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "invoiceId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "paymentIntentId"
      -        ]
      -      },
      -      {
      -        "required": [
      -          "chargeId"
      -        ]
      -      }
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "required": [
      +          "participantId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "participantEmail"
      +        ]
      +      }
      +    ]
      +  },
      +  {
      +    "anyOf": [
      +      {
      +        "required": [
      +          "externalId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "transactionId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "orderId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "paymentId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "invoiceId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "paymentIntentId"
      +        ]
      +      },
      +      {
      +        "required": [
      +          "chargeId"
      +        ]
      +      }
      +    ]
      +  },
      +  {
      +    "if": {
      +      "required": [
      +        "paymentProvider"
      +      ]
      +    },
      +    "then": {
      +      "required": [
      +        "testMode",
      +        "transactionId"
      +      ]
      +    }
      +  },
      +  {
      +    "if": {
      +      "not": {
      +        "required": [
      +          "paymentProvider"
      +        ]
      +      }
      +    },
      +    "then": {
      +      "not": {
      +        "required": [
      +          "testMode"
      +        ]
      +      }
      +    }
      +  }
      +]
    • addedInput schema / properties / paymentProvider
      Added value: +{
      +  "description": "Connected provider for the original payment. Requires its `transactionId` and `testMode`. This amends GrowSurf records without sending a refund through the provider.",
      +  "enum": [
      +    "stripe",
      +    "chargebee",
      +    "recurly"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / refundAmount / description
      Added value: +"Positive amount for this individual refund, no greater than the sale amount, in the sale currency's minor unit. Send it with `refundId` on each original refund to support cancellations and out-of-order amendments. The amount for a given `refundId` cannot change. A cancellation can omit it when the original amount is already recorded. Incomplete refund history returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation."
    • addedInput schema / properties / refundHistoryComplete
      Added value: +{
      +  "description": "Set true only after reconciling and recording every original refundId and refundAmount, including refunds later canceled. This confirmation resolves previously incomplete history. Omit during ordinary delivery. Replaying an old confirmation cannot resolve a later gap; confirm a newly reconciled refund or complete provider list.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / refundId / description
      Added value: +"Stable per-refund identifier. Required when canceling a refund or changing the refunded total after a cancellation. Reuse the original refund's identifier for its cancellation. An amendment without enough refund identity returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation."
    • addedInput schema / properties / testMode
      Added value: +{
      +  "description": "Original payment mode: `true` for test or `false` for live. Requires `paymentProvider`.",
      +  "type": "boolean"
      +}
  2. First observedv0.12.2

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already mark destructive and idempotent hints, but the description adds essential behavioral facts: "Already-paid commissions are not clawed back (recorded for tax only)" and "Targets `campaignId` if you pass it, otherwise GROWSURF_CAMPAIGN_ID." These details go beyond annotations and clarify side effects, tax treatment, and default targeting, giving the agent a fuller picture.

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

Conciseness5/5

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

The description is a single, well-structured paragraph with no filler. It front-loads the core purpose, then provides the inverse relationship, identification guidance, refund amount nuance, commission clawback caveat, and campaign targeting default. Every sentence carries useful information, and the length is appropriate for the tool's complexity.

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

Completeness3/5

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

For a tool with 21 parameters and a complex anyOf-required schema, the description covers the high-level intent and one nuance (full refund), but it omits critical usage context such as the mandatory identifier groups and the distinction between refundId/refundAmount for cancellations. The schema does carry these details for some fields, and the output schema covers return values, so the description is not entirely inadequate, but it leaves gaps that an agent must discover elsewhere. Given the complexity, a more complete description would reference these requirements.

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

Parameters2/5

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

With schema description coverage at only 29% (6 of 21 properties have descriptions), the description must compensate for the undocumented parameters. It only mentions amountRefunded ("omit amountRefunded for a full refund") and campaignId (default behavior). It does not explain the required group combinations (participantId/email plus one transaction identifier), nor the purpose of fields like refundStatus, description, or currency. The schema descriptions for some params are rich, but the main description adds little beyond two parameters, so it fails to support the majority of the API surface.

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?

The description opens with a specific verb-resource pair: "Record an amendment (refund, partial refund, or chargeback) against a previously recorded affiliate transaction," and clarifies its effect ("reverses or adjusts the referrer's commission"). It explicitly names the sibling relationship with "The inverse of growsurf_record_sale," which distinguishes it from the most relevant alternative.

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

Usage Guidelines4/5

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

The description provides clear when-to-use guidance: it is the inverse of growsurf_record_sale and gives operational details like "Identify the original transaction with the same identifier you sent when recording it" and "omit amountRefunded for a full refund." It does not explicitly list when not to use it, but the inverse relationship and the amendment context are sufficient for an agent to select it. No other sibling tools serve a similar reverse function.

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

Deploy Server

Other Tools