Skip to main content
Glama

Track Goal Event

track_goal

Record one completion of a custom goal. The goal is created on first use, so no setup call is needed; names are lowercase letters, digits, underscores, and hyphens, max 64 chars. Pass visitorUid (the _fs_vid cookie value of a visitor the tracking script has already seen) so the completion attaches to that visitor's sessions and source; omit it for an anonymous completion. Each call appends a completion, so repeating it counts the goal twice. Use track_payment for revenue, which records a payment goal on its own. Undo with delete_goals. Requires websiteId or domain with a workspace token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesGoal name: lowercase letters, numbers, underscores, hyphens only (max 64 chars). E.g. "newsletter_signup", "add-to-cart"
domainNoWebsite domain from list_websites (e.g. "example.com"). Alternative to websiteId with a workspace token.
metadataNoUp to 10 string key-value pairs stored with the completion. More than 10 fails with a 400.
websiteIdNoWebsite ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key.
visitorUidNoVisitor UID from the _fs_vid browser cookie of a visitor the tracking script has seen. Omit to record an anonymous completion.
workspaceIdNoWorkspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace do not exist in another

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultNoObject with status and data: a confirmation message. The completion itself is written asynchronously and appears in get_goals shortly after.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  2. Changed1 schema field changed
    • changedInput schema / properties / metadata / description
      Previous value: -"Up to 10 custom key-value pairs. Keys: lowercase, max 64 chars. Values: max 255 chars."New value: +"Up to 10 string key-value pairs stored with the completion. More than 10 fails with a 400."
  3. Changed1 schema field changed
    • addedInput schema / properties / workspaceId
      Added value: +{
      +  "description": "Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace do not exist in another",
      +  "type": "string"
      +}
  4. Changed5 schema fields changed
    • 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 / name / description
      Previous value: -"Goal name — lowercase letters, numbers, underscores, hyphens only (max 64 chars). E.g. \"newsletter_signup\", \"add-to-cart\""New value: +"Goal name: lowercase letters, numbers, underscores, hyphens only (max 64 chars). E.g. \"newsletter_signup\", \"add-to-cart\""
    • changedInput schema / properties / visitorUid / description
      Previous value: -"Visitor UID from the _fs_vid browser cookie"New value: +"Visitor UID from the _fs_vid browser cookie of a visitor the tracking script has seen. Omit to record an anonymous completion."
    • 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 goal event."New value: +"Object with status and data: a confirmation message. The completion itself is written asynchronously and appears in get_goals shortly after."
  5. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, not destructive, closed-world). The description adds behavior beyond them: auto-creation on first use, append semantics with the explicit warning that repeating counts the goal twice, visitor attribution behavior, and the auth requirement (websiteId or domain with a workspace token). That is exactly the value structured fields don't carry.

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?

Front-loaded with the core action, then behaviors, alternatives, undo path, and auth. Sentences are dense but each carries distinct information — no restatement of the title or filler.

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?

An output schema exists so return values need not be described. For a 6-param mutation with nested metadata, the description covers auto-creation, append/idempotency risk, attribution, alternatives, and auth — everything an agent needs to call it correctly.

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 nonetheless adds interpretation beyond the schema for visitorUid (what it is, and the consequence of omitting it: anonymous completion) and reinforces the name/websiteId/domain auth relationship, though name constraints are largely restated from the schema.

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: 'Record one completion of a custom goal.' It names the distinct sibling for adjacent work ('Use track_payment for revenue') and the inverse tool ('Undo with delete_goals'), so an agent can tell it apart from the other track_* tool without opening schemas.

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?

Explicit when/when-not/alternatives: no setup call needed since the goal is created on first use, use track_payment for revenue, undo via delete_goals, pass visitorUid to attribute vs omit for anonymous. Every routing decision is stated, not inferred.

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.

Resources