Skip to main content
Glama
Flowsery

flowsery

Official

Track Payment

track_payment

Record payments, refunds, and renewals, attributing revenue to visitors using identifiers. Use for accurate revenue tracking and goal completion.

Instructions

Record a payment so revenue appears in get_overview, get_timeseries, and the visitor profile. Skip it when the site's provider (Stripe, LemonSqueezy, Polar, and other connected providers) is tracked automatically; use track_goal for conversions without revenue. transactionId must be unique: a repeated id is rejected, not deduplicated. A new payment also records a payment goal completion (free_trial when amount is 0); isRenewal skips that. isRefund with an existing transactionId marks that payment refunded by amount instead of adding a row. Attribution looks up a known visitor by visitorUid, customerId, or email; with no match the revenue is kept but its source shows as Unknown. Requires websiteId or domain with a workspace token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoCustomer name
emailNoCustomer email
amountYesPayment amount in major currency units (e.g. 29.99). With isRefund, the amount refunded. 0 records a free_trial goal instead of a payment goal.
domainNoWebsite domain from list_websites (e.g. "example.com"). Alternative to websiteId with a workspace token.
currencyYesCurrency code (e.g. "USD", "EUR")
isRefundNoTrue to record a refund. With an existing transactionId, marks that payment refunded by amount instead of creating a new record.
isRenewalNoTrue for recurring/renewal charges. Renewals are counted in revenue but do not record the automatic payment goal.
websiteIdNoWebsite ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key.
customerIdNoCustomer ID from the payment provider. Also used to find the visitor when visitorUid is absent.
sessionUidNoSession ID for the current visitor session
visitorUidNoVisitor UID from the _fs_vid cookie. Strongly recommended: without it (or customerId/email matching a known visitor) the payment is attributed to Unknown
transactionIdYesUnique transaction ID from your payment provider. Must not repeat across payments; reuse it only with isRefund to mark that payment refunded.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNoObject with status and data: a confirmation message once the payment is stored.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.1.1
    • changedInput schema / properties / amount / description
      Previous value: -"Payment amount (e.g. 29.99)"New value: +"Payment amount in major currency units (e.g. 29.99). With isRefund, the amount refunded. 0 records a free_trial goal instead of a payment goal."
    • changedInput schema / properties / customerId / description
      Previous value: -"Customer ID from payment provider"New value: +"Customer ID from the payment provider. Also used to find the visitor when visitorUid is absent."
    • changedInput schema / properties / domain / description
      Previous value: -"Website domain to query. Required when using a workspace token unless websiteId is provided."New value: +"Website domain from list_websites (e.g. \"example.com\"). Alternative to websiteId with a workspace token."
    • changedInput schema / properties / isRefund / description
      Previous value: -"True for refunded payments"New value: +"True to record a refund. With an existing transactionId, marks that payment refunded by amount instead of creating a new record."
    • changedInput schema / properties / isRenewal / description
      Previous value: -"True for recurring/renewal payments"New value: +"True for recurring/renewal charges. Renewals are counted in revenue but do not record the automatic payment goal."
    • changedInput schema / properties / transactionId / description
      Previous value: -"Unique transaction ID from your payment provider"New value: +"Unique transaction ID from your payment provider. Must not repeat across payments; reuse it only with isRefund to mark that payment refunded."
    • changedInput schema / properties / visitorUid / description
      Previous value: -"Visitor UID from _fs_vid cookie — strongly recommended for accurate revenue attribution"New value: +"Visitor UID from the _fs_vid cookie. Strongly recommended: without it (or customerId/email matching a known visitor) the payment is attributed to Unknown"
    • changedInput schema / properties / websiteId / description
      Previous value: -"Website ID to query. Required when using a workspace token unless domain is provided."New value: +"Website ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key."
    • changedOutput schema / properties / result / description
      Previous value: -"Confirmation of the recorded payment."New value: +"Object with status and data: a confirmation message once the payment is stored."
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Annotations only indicate it's not read-only and not destructive. The description goes far beyond: it discloses that repeated transactionId is rejected (not deduplicated), that a new payment records a goal completion, that isRenewal skips that, that isRefund marks a refund instead of adding a row, and how attribution works when no visitor matches. All these behaviors are critical for correct invocation and are not in annotations.

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?

Every sentence earns its place. The description front-loads the core purpose, then covers exclusions and behavioral nuances in a logical flow. It is comprehensive but not redundant, and the structure guides the agent from general use to specific edge cases.

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?

Given 12 parameters, side effects (goal recording, refunds), uniqueness constraints, and attribution logic, the description covers all essential aspects an agent needs to invoke correctly. It even notes the requirement for websiteId/domain with a workspace token. With an output schema present, it doesn't need to describe return values, and it doesn't.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds meaning beyond field names: it explains that amount=0 records a free_trial goal, that amount with isRefund represents the refund amount, that transactionId must be unique, that isRefund requires an existing transactionId, that visitorUid is strongly recommended, and how customerId/email are used for attribution. This significantly enriches parameter understanding.

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 starts with a specific verb and resource: 'Record a payment'. It immediately states the effect (revenue appears in get_overview, get_timeseries, visitor profile) and explicitly contrasts with track_goal ('use track_goal for conversions without revenue') and with automatic provider tracking ('Skip it when the site's provider... is tracked automatically'). This clearly differentiates from sibling tools.

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?

Provides explicit conditions for use and non-use: when to skip (provider tracked automatically), when to use track_goal instead, and how to handle refunds via isRefund. It also specifies when a transactionId can be reused (only with isRefund). This is the highest level of guidance, leaving nothing to inference.

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