Skip to main content
Glama

PixelFlow

Get attribution

get_attribution
Read-onlyIdempotent

Get revenue and conversions for one site over a date range, broken down by traffic source, campaign, ad set, or ad, using PixelFlow's website attribution (the UTM tags and referrer of the converting visit). Each row has its event counts, revenue, unique visitors, and sessions. To drill down, pass the parent levels: campaign needs source; adset needs source and campaign; ad needs all three. Ranges before the plan's analytics lookback are refused, and a range too large to read at once is refused as range_too_wide with the largest range that fits. Use it for "which campaigns or ads drove conversions" questions.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site_id": "<site_id>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "get_attribution"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesRange end. YYYY-MM-DD means the end of that day in `timezone`, so the whole day is included; a full ISO 8601 timestamp is used as is.
fromYesRange start. YYYY-MM-DD means the start of that day in `timezone`; a full ISO 8601 timestamp is used as is.
adsetNoParent ad set key. Required for ad.
sourceNoParent source key from a previous result, such as facebook. Names are in list_supported_values's `sources`; (not set) for a blank source. Required for campaign, adset, and ad.
site_idYesSite to act on, as returned by list_sites.
campaignNoParent campaign key. Required for adset and ad.
group_byNoBreakdown level. Default source.
timezoneNoIANA time zone such as Europe/Berlin. Default UTC. Returned times and day buckets use it.

Output Schema

NameRequiredDescriptionDefault
rowsYesOne row per source, campaign, ad set, or ad.
windowYesExact range read, after applying timezone.
group_byYesBreakdown level used.
timezoneYesIANA time zone used for dates and times. UTC when none was passed.
event_countYesSum of total_events across rows.
attributed_revenueYesRevenue in the site currency: `amount` (number), `currency` (string or null), `events` (integer).
revenue_tracked_sinceYesSet when the range starts before PixelFlow began recording attribution revenue: revenue before this date is not counted.
excluded_valued_eventsYesValued conversions in another currency, left out of the revenue.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changed
    • addedOutput schema / properties / attributed_revenue / properties / currency / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / attributed_revenue / properties / currency / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
    • addedOutput schema / properties / revenue_tracked_since / anyOf
      Added value: +[
      +  {
      +    "format": "date-time",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / revenue_tracked_since / format
      Removed value: -"date-time"
    • removedOutput schema / properties / revenue_tracked_since / type
      Removed value: -[
      -  "string",
      -  "null"
      -]
    • removedOutput schema / properties / rows / items / properties / revenue / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / rows / items / properties / revenue / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "amount": {
      +        "description": "Revenue amount.",
      +        "type": "number"
      +      },
      +      "currency": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Currency code."
      +      },
      +      "events": {
      +        "description": "Valued events summed.",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "amount",
      +      "currency",
      +      "events"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / rows / items / properties / revenue / properties
      Removed value: -{
      -  "amount": {
      -    "description": "Revenue amount.",
      -    "type": "number"
      -  },
      -  "currency": {
      -    "description": "Currency code.",
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "events": {
      -    "description": "Valued events summed.",
      -    "type": "integer"
      -  }
      -}
    • removedOutput schema / properties / rows / items / properties / revenue / required
      Removed value: -[
      -  "amount",
      -  "currency",
      -  "events"
      -]
    • removedOutput schema / properties / rows / items / properties / revenue / type
      Removed value: -[
      -  "object",
      -  "null"
      -]
    • addedOutput schema / properties / rows / items / properties / sessions / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / rows / items / properties / sessions / type
      Removed value: -[
      -  "integer",
      -  "null"
      -]
    • addedOutput schema / properties / rows / items / properties / visitors / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / rows / items / properties / visitors / type
      Removed value: -[
      -  "integer",
      -  "null"
      -]
  2. Changed12 schema fields changed
    • changedInput schema / properties / adset / description
      Previous value: -"Parent ad set. Required for ad"New value: +"Parent ad set key. Required for ad."
    • changedInput schema / properties / campaign / description
      Previous value: -"Parent campaign. Required for adset and ad"New value: +"Parent campaign key. Required for adset and ad."
    • changedInput schema / properties / from / description
      Previous value: -"Range start. YYYY-MM-DD is the start of that calendar day in timezone. A full ISO instant is that instant"New value: +"Range start. YYYY-MM-DD means the start of that day in `timezone`; a full ISO 8601 timestamp is used as is."
    • changedInput schema / properties / group_by / description
      Previous value: -"source, campaign, adset, or ad. Omitted means source"New value: +"Breakdown level. Default source."
    • addedInput schema / properties / group_by / enum
      Added value: +[
      +  "source",
      +  "campaign",
      +  "adset",
      +  "ad"
      +]
    • removedInput schema / properties / site
      Removed value: -{
      -  "description": "Domain, id, or external id from list_sites",
      -  "type": "string"
      -}
    • addedInput schema / properties / site_id
      Added value: +{
      +  "description": "Site to act on, as returned by list_sites.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / source / description
      Previous value: -"Parent source. Required for campaign, adset, and ad"New value: +"Parent source key from a previous result, such as facebook. Names are in list_supported_values's `sources`; (not set) for a blank source. Required for campaign, adset, and ad."
    • changedInput schema / properties / timezone / description
      Previous value: -"IANA timezone. Omitted means UTC, and the response says UTC"New value: +"IANA time zone such as Europe/Berlin. Default UTC. Returned times and day buckets use it."
    • changedInput schema / properties / to / description
      Previous value: -"Range end. YYYY-MM-DD is the end of that calendar day in timezone, so later events that day are included. A full ISO instant is that instant"New value: +"Range end. YYYY-MM-DD means the end of that day in `timezone`, so the whole day is included; a full ISO 8601 timestamp is used as is."
    • changedInput schema / required
      Previous value: -[
      -  "site",
      -  "from",
      -  "to"
      -]New value: +[
      +  "site_id",
      +  "from",
      +  "to"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "attributed_revenue": {
      +      "additionalProperties": false,
      +      "description": "Revenue in the site currency: `amount` (number), `currency` (string or null), `events` (integer).",
      +      "properties": {
      +        "amount": {
      +          "description": "Revenue amount.",
      +          "type": "number"
      +        },
      +        "currency": {
      +          "description": "Currency code.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "events": {
      +          "description": "Valued events summed.",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "amount",
      +        "currency",
      +        "events"
      +      ],
      +      "type": "object"
      +    },
      +    "event_count": {
      +      "description": "Sum of total_events across rows.",
      +      "type": "integer"
      +    },
      +    "excluded_valued_events": {
      +      "description": "Valued conversions in another currency, left out of the revenue.",
      +      "type": "integer"
      +    },
      +    "group_by": {
      +      "description": "Breakdown level used.",
      +      "enum": [
      +        "source",
      +        "campaign",
      +        "adset",
      +        "ad"
      +      ],
      +      "type": "string"
      +    },
      +    "revenue_tracked_since": {
      +      "description": "Set when the range starts before PixelFlow began recording attribution revenue: revenue before this date is not counted.",
      +      "format": "date-time",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "rows": {
      +      "description": "One row per source, campaign, ad set, or ad.",
      +      "items": {
      +        "additionalProperties": false,
      +        "description": "One row.",
      +        "properties": {
      +          "event_counts": {
      +            "additionalProperties": {
      +              "type": "integer"
      +            },
      +            "description": "Count per event on this row, such as { \"Purchase\": 29 }.",
      +            "type": "object"
      +          },
      +          "key": {
      +            "description": "Source bucket, campaign, ad set, or ad name. (not set) for a blank tag. Pass it as the parent parameter to drill down.",
      +            "type": "string"
      +          },
      +          "revenue": {
      +            "additionalProperties": false,
      +            "description": "Revenue on this row, same fields as attributed_revenue.",
      +            "properties": {
      +              "amount": {
      +                "description": "Revenue amount.",
      +                "type": "number"
      +              },
      +              "currency": {
      +                "description": "Currency code.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "events": {
      +                "description": "Valued events summed.",
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "amount",
      +              "currency",
      +              "events"
      +            ],
      +            "type": [
      +              "object",
      +              "null"
      +            ]
      +          },
      +          "sessions": {
      +            "description": "Sessions on this row. null when the range is too large to read at once; ask for a shorter range.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "total_events": {
      +            "description": "All events on this row.",
      +            "type": "integer"
      +          },
      +          "visitors": {
      +            "description": "Unique visitors on this row. null when the range is too large to read at once; ask for a shorter range.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "key",
      +          "event_counts",
      +          "total_events",
      +          "revenue",
      +          "visitors",
      +          "sessions"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "timezone": {
      +      "description": "IANA time zone used for dates and times. UTC when none was passed.",
      +      "type": "string"
      +    },
      +    "window": {
      +      "additionalProperties": false,
      +      "description": "Exact range read, after applying timezone.",
      +      "properties": {
      +        "from": {
      +          "description": "First instant included.",
      +          "format": "date-time",
      +          "type": "string"
      +        },
      +        "to": {
      +          "description": "Last instant included.",
      +          "format": "date-time",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "from",
      +        "to"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "window",
      +    "timezone",
      +    "group_by",
      +    "event_count",
      +    "attributed_revenue",
      +    "excluded_valued_events",
      +    "revenue_tracked_since",
      +    "rows"
      +  ],
      +  "type": "object"
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"Range start, ISO date"New value: +"Range start. YYYY-MM-DD is the start of that calendar day in timezone. A full ISO instant is that instant"
    • changedInput schema / properties / to / description
      Previous value: -"Range end, ISO date"New value: +"Range end. YYYY-MM-DD is the end of that calendar day in timezone, so later events that day are included. A full ISO instant is that instant"
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses that ranges before the plan's analytics lookback are refused, and that oversized ranges fail with range_too_wide plus the largest range that fits. It also describes row contents (event counts, revenue, unique visitors, sessions), which is real operational context.

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

Conciseness4/5

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

Front-loaded with purpose, then drill-down rules, then error behavior, then the question it answers. Dense but each sentence carries information; the trailing use-case sentence could arguably be folded earlier, keeping it just under top marks.

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?

With an output schema present, return-shape detail is optional, yet the description still summarizes row fields. Combined with the drill-down prerequisites and the two documented refusal modes, an agent has everything needed to call it correctly or diagnose a failure.

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?

Schema coverage is 100%, so the baseline is 3; the description earns extra by spelling out the cross-parameter dependency chain between group_by and the parent keys (source/campaign/adset), which is a constraint the per-field schema text only states piecemeal.

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?

States a specific verb and resource (revenue/conversions for one site over a date range) plus the four breakdown dimensions and the attribution model used (UTM tags and referrer of the converting visit). This is clearly distinguishable from siblings like get_overview or list_events without opening the schema.

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 an explicit use case ("which campaigns or ads drove conversions") and the hierarchical drill-down rules (campaign needs source; adset needs source and campaign; ad needs all three). It does not name an alternative sibling 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.