Skip to content
SaaSFunnelsHelp

Build with your agent · Reference

For AI agents

Instructions for AI coding agents building SaaSFunnels Funnels through the hosted MCP server: the tool order from template to request_publish, the rules (agent_name, request_key, render after every design change, run_funnel_test, never publish), what needs the merchant's approval, and the limits.

On this page

This page is written for you, the AI agent. Follow it when a merchant asks you to build, change, test or launch a SaaSFunnels Funnel from their repository. The playbooks that npx saasfunnels agent install writes say the same thing.

Connect

  • Hosted MCP server: https://app.saasfunnels.com/mcp (Streamable HTTP). The merchant signs in with OAuth. Never ask for, accept or store an API key for it.
  • If the merchant has more than one workspace, call list_workspaces and pass workspace_id to every other tool.
  • Draft edits need the merchant to be a workspace owner or admin. If a tool answers "Agents can't edit Funnel drafts in this workspace…", stop editing, tell the merchant, and keep to reads and checks.

Build a Funnel, in this order

This is the launch_funnel prompt.

  1. list_funnel_templates. Start here. Pick the template closest to the merchant's goal.
  2. create_funnel_draft with template_key (and feature_key when the template needs one), or blank. Pass a new UUID as request_key so a retry never makes a second draft.
  3. get_install_status. If the merchant's site isn't allowed yet, call propose_allowed_site and give them the link it returns.
  4. get_launch_checklist. Then wire the entry into the merchant's code: propose_funnel_entry_installation, make the code change it describes, apply_funnel_entry, then submit_funnel_entry_evidence.
  5. confirm_event_mapping for any event you added or that the checklist names.
  6. run_funnel_binding_test with a test token, in the merchant's running app.
  7. get_funnel_outline, then edit with apply_funnel_changes, then render_funnel_step and validate_funnel_draft, and finally run_funnel_test.
  8. request_publish, then give the merchant the Studio link.

Rules

  • Set agent_name to your own name (for example "Claude Code") on apply_funnel_changes, so the merchant sees who changed what in Studio's Agent activity.
  • Pass a request_key UUID on create_funnel_draft. Reuse the same key when you retry the same request.
  • Never publish. You can't, and you must not tell the merchant something is live. Call request_publish; the merchant approves it in one click in Studio or from the email.
  • Render after every design change. Call render_funnel_step at desktop (1440 × 900) and mobile (390 × 844), or both, and fix what you see before moving on. Use variant_key for an A/B variant. render_funnel draws up to 8 steps at once.
  • Run run_funnel_test after your last edit. Any edit after it makes it out of date. Request publish only when it returns ready_to_publish: true, or tell the merchant what still blocks it.
  • Give the Studio link in every reply that changes a draft.
  • Ask for what only the merchant knows, such as a review page link or which plan to offer. Never invent links, prices, discounts or customer names.
  • Keep credentials out of chat. Never print, paste or commit a key. Use placeholders in code and point the merchant to their secret manager.
  • Batch edits. apply_funnel_changes takes up to 16 commands and saves all or nothing, as one change the merchant can undo. Call get_funnel_command_schema for the commands. For a large rewrite, use get_funnel_definition and update_funnel_draft (the whole definition or a JSON Patch), which is also one undoable change.
  • Look up what exists. get_funnel_design_reference lists every element, layout, surface and built-in image with an example. get_targeting_catalog lists the merchant's real events, account facts and pages. get_offer_catalog lists their real plans, prices and discounts.
  • Clean up. Archive a never-published draft you made for testing with archive_funnel_draft. The merchant can restore it.

Approvals

These need the merchant. Prepare them, tell the merchant, and give them the link or place:

ChangeWhat you doWhere the merchant finishes it
Publishingrequest_publishStudio, or the approval email
A new discountPrepare it in the draft with compose_offerStudio creates it in Stripe
Offer termsreview_offer_terms checks them against Stripe and creates nothing. An owner or admin signed in with OAuth can approve themOtherwise, Studio
Brand kitupdate_brand_kit saves it for owners and admins; otherwise propose_brand_kitThe approve link
A new sitepropose_allowed_siteThe link opens Settings → Install code; an admin saves it
A new tool, like SlackNothingSettings → Integrations. save_funnel_routes and set_answer_delivery work only with tools already connected

What you can't do

You can't publish, delete a published Funnel, change billing, plans, permissions or identity, change what customers can access, or move money. Don't try to work around these.

Custom code

  • Custom CSS on the Funnel: set_custom_css through apply_funnel_changes, or update_funnel_draft. Custom HTML is an element (Add element › Content).
  • When the merchant has turned on the custom code lock (set_custom_code_lock), custom-code changes are turned down. Tell the merchant; don't unlock it yourself unless they ask.
  • Up to 20 KB of CSS and 20 KB of HTML. HTML allows text, lists, https links, images and tables; no scripts, iframes, forms, inputs, SVG, event handlers, javascript: or data: URLs. CSS: no @import, no position: fixed, and url() only to the workspace image library.
  • Link clicks inside custom HTML aren't counted in Results yet.

Funnels drawn by the merchant's app

To match the merchant's app, use the brand kit and custom CSS first: Studio shows those exactly. Mark a Funnel drawn by the app only when it needs the app's own components. Use the build_custom_designed_funnel prompt, mark it with set_drawn_by_app through apply_funnel_changes, then:

  1. Run npx saasfunnels funnels types <funnel_id> to write TypeScript types for its steps, fields and buttons.
  2. Build the merchant's components with useFunnelResponseStep and useFunnelActionChoices from @saasfunnels/funnels-react (or the browser runtime's equivalents without React). They return full step content with merge fields filled in.
  3. Leave targeting, timing, frequency, the step order, answer routing, Offers, payments and measurement to SaaSFunnels. Never confirm a payment in the browser.
  4. Studio edits these steps' content and order but not their look. Its Preview opens the merchant's app with the draft, at the address set in Funnel settings › Drawn by your app. Check them in the app with run_funnel_binding_test.

Other prompts

PromptArguments
launch_funnelgoal, template
add_cancellation_flow
recover_failed_payments
edit_funnelfunnel_id, change
improve_funnelfunnel_id
build_custom_designed_funnel

Limits

  • 120 tool calls a minute.
  • apply_funnel_changes: 16 commands per call.
  • render_funnel: 8 steps per call.
  • import_funnel_image: a public https PNG, JPEG, WebP or AVIF up to 10 MB. Use create_image_upload for a local file.
  • Results periods: 7d, 30d, 90d or 12m.

Full tool list: MCP server.

What's next

MCP server reference