# Use your agent to find the next growth test

I’d work backward from activation and qualified demand. Start with where people get stuck on the website, through trial onboarding and in email. Improve how we help the people already here, then use what we learn to shape external and paid campaigns.

This workflow tackles one slice: the trial audience that might benefit from more useful onboarding help. Historical records help choose where to investigate. A prospective experiment tests whether a change works.

The first output is an audience, a field-gap report, historical outcomes and a proposed next test. The replay uses plain SQL without native AI calls. MotherDuck compute, storage and your agent’s normal usage limits still apply. The optional Jev review is a separate, billed AI step.

## Connect the two tools

Check your agent’s available tools first. Reuse existing connections rather than registering duplicates.

| Connection | Its job | Access |
|---|---|---|
| Duck Yeah | Supplies public templates and the saved synthetic demonstration. | No sign-in. Receives only an analysis cutoff for the history template. |
| MotherDuck | Inspects your schema and runs the mapped SQL in your account. | Your authenticated MotherDuck connection and its permissions. |

Duck Yeah’s public endpoint is:

```text
https://jamesdnichols.com/duck-yeah/mcp/
```

The page’s **Copy endpoint** button uses the current deployment’s URL. Keep customer rows, SQL, schema details and credentials out of Duck Yeah tool arguments. Your connected agent and MotherDuck process your data under your organization’s chosen access and data policies; “in your environment” does not mean the agent is an offline tool.

### Claude Code

Run only the commands for connections you are missing:

```sh
claude mcp add --transport http duck-yeah https://jamesdnichols.com/duck-yeah/mcp/
claude mcp add --transport http MotherDuck https://api.motherduck.com/mcp
```

Open `/mcp`, select MotherDuck and authenticate. Check that your agent can see Duck Yeah’s `get_history_replay_template` and MotherDuck’s query guide and database tools before proceeding. MotherDuck’s [current setup guide](https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-setup/) covers authentication and client-specific details.

### Claude, Codex and other clients

- **Claude:** find MotherDuck under **Customize → Connectors**. Add Duck Yeah as a custom connector with its endpoint where your plan supports custom connectors.
- **Codex:** install the official MotherDuck plugin, start a new chat and verify that its tools can see your intended database. Add Duck Yeah as a remote HTTP MCP server in your client’s MCP settings.
- **Other clients:** configure Duck Yeah as a Streamable HTTP server and follow the [MotherDuck client setup guide](https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-setup/) for your private connection.

An OAuth connection and a manually configured read-scaling token are alternative authentication paths. If you need database-enforced read-only access, follow MotherDuck’s [read-only access instructions](https://motherduck.com/docs/key-tasks/ai-and-motherduck/securing-read-only-access/) for a read-scaling token. A client rule that denies `query_rw` can restrict agent tool use, but it is different from a server-enforced token permission. Never paste tokens into a prompt, public template or Duck Yeah endpoint.

## Start with the history replay

Paste this into your connected agent:

> Help me decide which trial audience deserves our next growth test. First verify that Duck Yeah's public template tools and my MotherDuck tools are connected. Ask me to choose an explicit analysis cutoff, then call `get_history_replay_template` with `snapshotAt` as an ISO timestamp with a timezone. Use MotherDuck's query guide and schema to map one row per trial account, preserving what was known by day 3. Show the mapping and run the field-readiness check before interpreting a rate. Keep all account data and SQL in my environment; send only the cutoff to Duck Yeah. Run readiness and summary as read-only SELECTs over the complete mapped audience. Inspect candidate rows with an outer `LIMIT 10` or explicit paging; never derive counts or rates from truncated returned rows. Report the eligible audience, unresolved outcomes, and qualification by task and intent with denominators. Explain what the history supports, what remains unknown, and the smallest useful next test. Historical differences are not evidence that the proposed offer caused an improvement.

The tool requires one argument. Choose a deliberate observation cutoff rather than copying this example date:

```json
{"snapshotAt":"2026-09-30T00:00:00Z"}
```

It returns the input contract and SQL for mapping, field readiness, account replay and the summary. Adapt the example source relation or `history_input` CTE privately to your schema. Python is not required for this path. Duck Yeah does not execute the SQL or connect to your warehouse. To inspect the worked synthetic example instead, call `get_history_plan`.

MotherDuck MCP query responses are capped at 2,048 rows and 50,000 characters. Compute readiness and summary aggregates in SQL over the complete mapped audience. For inspecting individual candidates, wrap the candidate query with an outer `LIMIT 10` or use deliberate paging; do not put that inspection limit into the mapping or summary query. Returned candidate rows can be truncated and are not a reliable source for reconstructing audience counts or rates.

### What to map

| Purpose | Fields |
|---|---|
| Decide who was eligible at day 3 | `account_id`, `trial_started_at`; `company_fit` and `company_fit_available_at`; `email_eligibility`, `email_eligibility_available_at` and `email_eligibility_policy`; `first_own_data_query_at` and `first_own_data_query_available_at`. |
| Describe later qualification | `qualification_outcome`, `qualification_at`, `outcome_observed_through_at` and `outcome_recorded_at`. |
| Compare segments | `team_task`, `team_task_available_at`, `evaluation_intent` and `evaluation_intent_available_at`. These signals are optional for inclusion; map missing evidence to the documented unknown/null values. |

“Available” means the fact had occurred and your systems had received it. A day-2 event imported on day 5 was not available on day 3. Use timestamps with explicit timezones and inspect the full [input contract](history-what-if.md) before querying.

The readiness query runs **after this mapping**. It reports missing, unknown or late fields independently, so one exclusion does not hide another gap. It cannot discover an unknown CRM schema automatically or reconstruct a historical audit trail that does not exist. If historical fit or program eligibility cannot be established, return a data-readiness finding and a capture plan; do not present the resulting partial audience as a reliable qualification baseline.

### What a useful readout contains

1. The audience and mutually exclusive exclusion counts, with invalid inputs resolved before interpretation.
2. Mature and unresolved outcomes, with denominators beside every segment rate. A missing event does not establish a confirmed non-qualification.
3. Task and intent breakdowns that suggest what to investigate, plus alternative explanations. A historical association does not establish causality; flat historical rates do not rule out a useful assistance test.
4. A feasible next test with a success measure, protections, sample plan and next action for a positive, negative or inconclusive result.

Available review hours cover the **whole selected audience**, not an assumed weekly allowance. Review minutes are a gross per-candidate assumption. Enrichment, outreach, meetings and follow-up need separate allowances; this is not total Sales cost or an ROI calculation.

## Optional: have Jev prepare account reviews

Use this step if reading account notes is the bottleneck. It is separate from the SQL replay. MotherDuck’s native `prompt_jev` is a preview AI function available to eligible Lite and Business organizations with AI functions enabled. It is not supported in Frankfurt or Dublin at this documentation check. Native AI usage is billed, and supplied text is processed by TypeSafe in the US. Check the [current function reference and availability](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/prompt-jev/) and your organization’s data requirements before running it.

> Get Duck Yeah's `get_candidate_review_template` with `execution: motherduck`. Use my MotherDuck tools to map source notes available at the decision cutoff. Before inference, show a deliberately mixed batch of at most five packets: clear needs, unclear or conflicting notes, and missing or late evidence. Select that batch in the mapping before the template's ID order and limit. Run the no-model preview first. Check my organization's native AI availability and usage terms, and show me the proposed input before I authorize `prompt_jev`. Return source quotes, complete answers, unresolved cases and a useful next step for each account. Keep email-program eligibility separate from the recommendation. Do not send messages, update the CRM or mark accounts qualified.

The native template orders packets by ID and selects at most five; it does not create a representative sample for you. Choose that batch in the mapping first. A no-model preview checks inputs and cutoff handling, not model quality. Save model results and usage receipts before considering another run. Measure human review time and usefulness if you want to claim that this step improves the process.

See the [candidate review guide](candidate-review.md) for the packet contract, source checks and separate Vercel rehearsal. A read-only SQL statement containing `prompt_jev` still performs inference. Neither template sends messages or writes to a CRM.

Setup documentation checked September 30, 2026. Provider setup paths and preview availability can change; the linked official documentation is the current reference.
