Skip to main content
Glama
growsurf

GrowSurf MCP Server

Official

Record Sale

growsurf_record_sale
Idempotent

Record an affiliate sale or transaction and de-duplicate repeat calls using a transaction ID. Reuse the same ID for refunds; listen to webhooks for commission updates.

Instructions

Record a sale/transaction for an affiliate program. Use webhooks to know when commissions are added. Requires at least one transaction identifier (externalId, transactionId, orderId, paymentId, invoiceId, paymentIntentId, or chargeId) so repeated calls are de-duplicated instead of double-paying the referrer; reuse the same one when refunding. Targets campaignId if you pass it, otherwise GROWSURF_CAMPAIGN_ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paidAtNo
orderIdNo
chargeIdNo
currencyYes
testModeNoRequired with `paymentProvider`: `true` for test or `false` for live. Otherwise omit.
invoiceIdNo
netAmountNo
paymentIdNo
taxAmountNo
amountPaidNo
campaignIdNoTarget program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Program IDs also identify newly created programs without restarting the server.
customerIdNo
externalIdNo
totalTaxesNo
descriptionNo
grossAmountYes
invoiceTotalNo
amountCashNetNo
participantIdNo
transactionIdNo
subscriptionIdNo
totalTaxAmountNo
paymentIntentIdNo
paymentProviderNoConnected provider for this payment. Requires `transactionId` and `testMode`. Supply matching `grossAmount` and `currency`; other payment IDs and tax or net-amount overrides are not accepted. GrowSurf reads payment details from the provider and detects duplicate webhook/API/manual submissions.
totalTaxAmountsNo
participantEmailNo
invoiceTotalExcludingTaxNo
invoiceSubtotalExcludingTaxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoHuman-readable result message.
successNo`true` when the sale was recorded; `false` when it matched an existing transaction.
duplicateNo`true` when the sale matched an existing transaction.
firstSaleNoWhether this was the referred customer's first recorded sale.
duplicateFieldsNoIdentifier fields that matched an existing transaction.
commissionsCreatedNoCommissions created by this duplicate request.
matchingCommissionIdsNoCommission ids that matched the submitted identifiers.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.19.9
    • changedInput schema / properties / campaignId / description
      Previous value: -"Target 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."New value: +"Target program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Program IDs also identify newly created programs without restarting the server."
  2. Changed3 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 this payment. Requires `transactionId` and `testMode`. Supply matching `grossAmount` and `currency`; other payment IDs and tax or net-amount overrides are not accepted. GrowSurf reads payment details from the provider and detects duplicate webhook/API/manual submissions.",
      +  "enum": [
      +    "stripe",
      +    "chargebee",
      +    "recurly"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / testMode
      Added value: +{
      +  "description": "Required with `paymentProvider`: `true` for test or `false` for live. Otherwise omit.",
      +  "type": "boolean"
      +}
  3. First observedv0.12.2

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false; the description goes further by explaining the de-duplication mechanism (identifier reuse prevents double-paying) and the campaign-targeting fallback, which an agent cannot infer from the schema. It stops short of covering retry/error behavior or auth requirements.

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?

Three dense sentences, each earning its place: purpose first, then the commission/webhook workflow, then the identifier requirement and campaign targeting. No filler or repetition.

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

Completeness4/5

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

With an output schema present, return values need no explanation, and annotations cover the safety profile. The description covers the critical required-identifier rule and dedup semantics, though it omits participant identification and amount/currency semantics, which is a notable gap for a 28-parameter tool.

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 only 11% across 28 parameters, so the description must carry the load; it usefully enumerates the seven accepted transaction identifiers and the campaignId default. However, ~25 parameters (currency, grossAmount, participantId/participantEmail, paymentProvider constraints, amount fields) are left to an under-documented schema.

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

Purpose4/5

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

States a specific verb and resource ('Record a sale/transaction for an affiliate program') and scopes it to a program/campaign. It implicitly distinguishes itself from growsurf_refund_transaction by tying the identifier to refunds, but does not name that sibling explicitly.

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?

Gives concrete context: use webhooks to learn when commissions are added, at least one transaction identifier is mandatory, reuse the same identifier when refunding, and campaignId falls back to GROWSURF_CAMPAIGN_ID. No explicit when-not or named-alternative routing, but the workflow guidance is clear.

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