Skip to main content
Glama

Set conversion goals

set_goals
Idempotent

Set conversion goals for a landing page. Goals define what counts as a "conversion" — the primary actions you want visitors to take. You can set multiple goals per page.

Conversion rate is calculated from unique visitors who completed at least one configured goal. Each goal is still tracked separately in analytics, and improvement suggestions adapt to goal types.

Examples:

  • User says "カフェの予約ページを作って" → goals: [{ goalType: "cta_click", label: "予約サイトへ" }]

  • User says "資料請求と LINE 登録ができるページ" → goals: [ { goalType: "form_submission", label: "資料請求フォーム" }, { goalType: "cta_click", label: "LINE登録" } ]

IMPORTANT: Always call this after create_site when the page purpose is clear. If the user mentions forms, inquiries, signups → include form_submission goal. If the user mentions external links, bookings, LINE, phone, EC store → include cta_click goal. Calling this replaces all existing goals for the page.

Input Schema

NameRequiredDescriptionDefault
goalsYesList of conversion goals (1-5)
siteIdYesThe ID of the page to set goals for

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / siteId / description
      Previous value: -"The site ID to set goals for"New value: +"The ID of the page to set goals for"
  2. Changed2 schema fields changed
    • changedInput schema / properties / goals / items / properties / goalType / description
      Previous value: -"'form_submission': visitors submit a form. 'cta_click': visitors click a CTA to an external destination."New value: +"'form_submission': visitors submit a form. 'cta_click': visitors click a CTA to an external destination. 'order': visitors place an order on the page's order form (after enable_orders and the seller's setup); analytics then report its orders and revenue, and the conversion total is an estimate (conversionsEstimated)."
    • changedInput schema / properties / goals / items / properties / goalType / enum
      Previous value: -[
      -  "form_submission",
      -  "cta_click"
      -]New value: +[
      +  "form_submission",
      +  "cta_click",
      +  "order"
      +]
  3. First observed

TDQS

A3.9/5.0
Behavior1/5

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

The annotations declare destructiveHint=false, but the description states 'Calling this replaces all existing goals for the page,' which is a destructive overwrite of existing goal configuration. This is a direct contradiction with the annotation, even though the description otherwise provides useful behavioral context about conversion calculation and tracking.

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?

The description is front-loaded with purpose and usage rules, then uses examples to clarify goal selection. It is somewhat long but well-structured, and the examples and replacement warning earn their 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 two-parameter mutation tool with a rich input schema and no output schema, the description covers purpose, prerequisites, goal-type selection, and replacement behavior. The main gap is the annotation contradiction and the absence of an explicit alternative such as list_goals for reading existing goals.

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 schema already documents both parameters and nested goal fields. The description adds value by giving concrete examples that map user utterances to goalType and label values, and by explaining when to choose form_submission versus cta_click.

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: set conversion goals for a landing page. It defines what a goal is and clarifies that multiple goals can be set per page, making the tool's purpose immediately clear.

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?

Explicitly says to call this after create_site when the page purpose is clear, and gives concrete rules for when to include form_submission versus cta_click based on user intent. It also warns that calling it replaces all existing goals, which is critical usage context.

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.