Skip to main content
Glama

Build a test

build_test

Creates a LiveVariant test and returns every URL needed to run it, plus a freshly generated stats secret.

Pass variants to test one element, or slots to test several at once (hero image AND call-to-action, say). With slots the test optimizes the COMBINATION: one model learns how the elements interact, which two separate tests structurally cannot see. There is no algorithm to pick either way; every test runs the same joint model, sized from its shape.

By default, nothing is registered anywhere: the config IS the test, encoded into the URLs, and the test's identity is a hash of it. Pass publishableKey on an account-enabled deployment to also register the new test to that key's organization, so it appears under My tests; the config and URLs are still the test, and registration failure is returned as a warning rather than failing the build. Editing a variant later produces a DIFFERENT test with its own empty history, which is usually what you want per campaign but is worth saying out loud to whoever you are building this for.

The stats secret is returned once and never again. Only its hash goes into the config, so nobody, including this service, can recover it. Give it to the person who will read the results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoA label for your own reference, and the one field worth spending a merge tag on in a recurring ESP template: it is part of the test's identity, so n={{campaign_name}} mints a separate, separately readable test per campaign, and the name is what list_tests searches.
slotsNoMulti-element test: variants per element, keyed by a short name like "hero" or "cta". The test serves and learns combinations.
regionNoWhere the test's state lives. A placement hint (wnam, enam, sam, weur, eeur, apac, oc, afr, me) or "eu" for the EU jurisdiction (state guaranteed created and kept inside the EU). Defaults to the creator's own region when the host can tell; without any, state is born wherever the FIRST request comes from, which in email is routinely a mail provider's US datacenter.
contextNoDimensions to learn a separate winner for.
variantsNoSingle-element test: two or more variants. The first is the control.
redirectUrlNoWhere clicks land when a variant does not say.
variantParamNoStamp the served combination into this parameter on redirect, e.g. "utm_content", so the test shows up in the customer's own analytics.
slotRedirectsNoWhere clicks on ONE element land, when elements point at different pages (a hero leading to the campaign landing page, a CTA below it to pricing). Keyed like `slots`. Falls back to `redirectUrl`; a variant's own redirectUrl still wins over both. Setting any of these means every click link must name its slot, which slotLinks does for you.
publishableKeyNoRegisters the new test to the organization identified by a publishable key the user provides for an organization they administer. Result access stays tied to this test's stats secret. Only works on account-enabled deployments; elsewhere a warning says so and the test still works.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYes
slotsYesCanonical slot order with variant names, as stats reports them.
configYesThe encoded config: this is the test.
regionYesWhere the test's state will live; null means first-request placement.
testIdYes
warningsYes
slotLinksNoMulti-slot tests only: the serve/click URL per element. The bare urls.serve returns 400 for these tests, because a serve must say which element it renders. The bare urls.click works when the destination is uniform (a config redirectUrl or ?to=); per-slot clicks matter as soon as an element carries its own destination, via slotRedirects or a variant redirectUrl.
statsSecretYesShown once. Store it now.
combinationsYesHow many distinct combinations the test chooses between.
destinationsNoRedirect destinations and whether each is a verified domain. Unverified means visitors see a 'Redirecting you to…' continue screen before landing; relay the verification warning to the user when present.
registeredToNoThe organization the test was registered to, when a publishableKey was given and accepted.
emailTemplateNoQuery-parameter spelling per slot for an ESP template: wire it once, then campaign managers fill only the merge fields. All links share one identical config string (names, ctx dims, kh and the landing r=/sr= included, so serve and click stay ONE test); image links add &slot= per element. The click link needs no slot unless the test sets slotRedirects, in which case each element's click link carries its own. Absent when a variant has inline content or its own redirectUrl, which the parameter form cannot express.

TDQS

A4.3/5.0
Behavior5/5

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

The description reveals behaviors annotations do not convey: the stats secret is returned once and unrecoverable, only its hash is stored, no registration occurs by default, registration failure is only a warning, and editing a variant creates a new test with empty history. These are exactly the non-obvious traits an agent must know. There is no conflict with the 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?

Four topically organized paragraphs: core promise, variants-vs-slots, registration/identity, and secret lifecycle. It is long, but every sentence carries a caveat or decision that would otherwise be missing, and the most important return semantics are front-loaded. This is appropriately sized for a 9-parameter tool with nested objects.

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 high-complexity tool with rich schema and output schema, the description covers the critical hidden behaviors: one-time secret, identity hashing, registration warning, and test replacement on edit. The one notable gap is that it never explicitly states that at least one of variants or slots is required, despite the schema listing zero required parameters. Because of that, an agent could attempt a meaningless empty build.

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?

The input schema already covers 100% of parameters, so the baseline is 3; the description adds conceptual meaning by framing slots as combination optimization, variants as single-element control tests, and publishableKey as an optional registration side-effect. It also clarifies that the config/URLs are the test and identity is a hash, which gives semantic weight to name, variants, and context. It does not duplicate schema field descriptions, which is appropriate at full coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names the operation (creates), the object (LiveVariant test), and the payload (URLs + stats secret), which is immediately informative. The later paragraphs clarify the no-registration default and optional publishableKey registration, so it can be told apart from a pure registration tool. It never explicitly names a sibling alternative, so it stops short of full 5.

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?

The description gives explicit selection guidance for variants vs slots, explaining when each is appropriate and that both run the same joint model. It also states the exact condition for registration (pass publishableKey on an account-enabled deployment) and that failure degrades to a warning. It does not enumerate alternative sibling tools or state a when-not-to-use condition, so it lacks explicit exclusionary guidance.

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.

TDQS

A4.2/5.0
Disambiguation4/5

Each tool targets a distinct phase of the test lifecycle—building, priors, stats, registry status, inspection, listing, registration, asset upload, and briefing—so an agent can usually select correctly. The only mild overlap is between get_test_status and inspect_test, and between build_test with registration versus register_test, but the descriptions draw clear boundaries.

Naming Consistency4/5

Almost all tools follow a consistent snake_case verb_noun pattern: build_test, get_stats, register_test, upload_image. The single outlier is variant_brief, which is a noun phrase rather than an action verb, making the set slightly less predictable.

Tool Count5/5

Nine tools is well within the ideal range for a focused A/B testing server. Each tool earns its place and there is no obvious redundancy or bloat.

Completeness4/5

The core workflow is well covered: get constraints, build a test, optionally register it, set priors, inspect it, check status, and fetch stats. Minor gaps exist—there is no explicit stop/archive/delete test operation and domain verification is dashboard-only—but these are workaroundable given the immutable-test design.