Skip to main content
Glama
growsurf

GrowSurf MCP Server

Official

growsurf_record_sale

Idempotent

Record affiliate sales and transactions with a unique identifier to prevent duplicate commission payouts.

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. Pass the `id` returned by growsurf_create_campaign to configure or operate a program you just created, 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. 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"
      +}
  2. First observedv0.12.2

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the idempotentHint annotation, the description discloses the real-world consequence of duplicate calls ('double-paying the referrer'), explains that identifiers enable de-duplication, and advises reusing the same identifier when refunding. This is valuable behavioral context; it doesn't cover auth or side-effect details, but annotations already cover safety.

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 sentences, no filler. The core action, key requirement, deduplication rationale, and campaign targeting behavior are all front-loaded and each sentence earns its place.

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?

For a 28-parameter tool with complex conditional requirements, the description plus schema and output schema cover the essentials: required identifier group, dedup behavior, campaign default, and paymentProvider nuances are in the schema. It could mention the participantId/participantEmail requirement explicitly, but the schema's allOf already encodes it.

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

Parameters4/5

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

With only 11% schema description coverage, the description compensates by enumerating the accepted transaction identifiers and explaining why one is required, and by stating campaignId targeting with GROWSURF_CAMPAIGN_ID fallback. It does not explain amount units or participant selection, but it addresses the most non-obvious parameters.

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?

Opens with a specific verb and resource: 'Record a sale/transaction for an affiliate program.' The description also explains the deduplication purpose, which distinguishes this write/record tool from siblings like refund_transaction and add_participant.

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 makes clear this tool is for recording sales/transactions and mentions the webhook follow-up for commissions, giving solid context. It does not explicitly name alternatives or state when not to use it, so it stops short of a 5.

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