Skip to main content
Glama

Set conversion goal

set_goal
DestructiveIdempotent

Define the page's conversion goal so analytics can report a real conversion RATE (conversions ÷ sessions), not just behavioral proxies. The goal is either a CTA click (matched by button/link text, url, and/or section) or a form submission (by name, or any form). Changing the goal re-scores all past data instantly — nothing is migrated. Use action "clear" to remove the goal.

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": {
      "pageId": "<pageId>"
    },
    "name": "set_goal"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoclick goal: match the element by where its link leads — an outside URL (or part of it), or "#anchor" for a link to a section of this page, e.g. "#pricing". Buttons lead nowhere: match them by text.
textNoclick goal: match the element by its button/link text as the page's HTML has it (case-insensitive substring), e.g. "Get started". Visitors reading a translation still count.
typeNoclick = a tracked click on the converting element; form = a form submission. Required for "set".
labelNoOptional human label for the conversion shown in analytics. Auto-derived when omitted.
actionNoSet (default) or clear the goal.
pageIdYesThe pageId returned when the page was published.
sectionNoclick goal: restrict the match to a section id (e.g. "hero").
formNameNoform goal: restrict to one form by its name (data-form). Omit to count submissions of ANY form.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds the crucial consequence behind that flag: changing the goal re-scores all past data instantly with no migration. That tells the agent the change is retroactive and potentially re-interpretive of historical reporting, which annotations alone would not convey. It does not cover validation or failure behavior when a match target is never found.

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, front-loaded with purpose and payoff, then the two goal types, then the retroactive-rescoring caveat, then the clear action. No restated schema text and nothing wasted.

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 an 8-parameter mutation with no output schema, the description covers what the tool changes, the two matching modes, and the data-history effect. Minor gaps remain around how the agent confirms the goal was set or what happens on an ambiguous/no match, but nothing essential to calling it is missing.

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, but the description supplies the conceptual model that ties parameters together: a click goal matches by text, url, and/or section, while a form goal matches by name or any form. That relationship is not obvious from the flat property list and helps the agent choose which parameters to combine.

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 ("Define the page's conversion goal") plus the payoff (real conversion rate rather than behavioral proxies). It implicitly distinguishes this from analytics-reading siblings like get_analytics and from set_form_rules by framing the goal as a click or form-submission match.

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 clear conditions for the two goal modes (CTA click vs form submission) and explicitly routes the removal case to action "clear". It stops short of naming sibling tools such as get_analytics, so an agent must infer that this is the write-side counterpart to conversion reporting.

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.