# Otherwise > Otherwise builds Shopify Functions as flows of steps: discounts, checkout validations, delivery and payment rules, and bundles. A merchant connects their own AI agent to it, and the agent builds, tests and publishes functions for them. ## Connect - MCP server (streamable HTTP): https://functions.otherwise.run/mcp - Signing in is OAuth, with no key to paste. The merchant is sent to their Shopify admin, chooses what the agent may do (read, draft, or publish) and approves. - A tool that can't sign in uses a token the merchant makes on the app's Agents page, sent as a bearer token. ## If you are an agent asked to set this up 1. Add https://functions.otherwise.run/mcp as a connector or MCP server, named "Otherwise". 2. Tell the merchant when it is ready for them to sign in. They approve it inside Shopify; you never see a password. 3. Call get_store and list_functions. Tell the merchant which store you are connected to and what is there. Each connection works in one Shopify store only, the one the merchant approved. Don't ask which store, and don't use another connector or another store's data for it. ## How to work 1. list_step_types for the kind of function, to see its steps, settings and rule fields. 2. list_templates, and get_template when one is close to what the merchant asked for: a ready-made flow that is known to work is a better start than an empty one. 3. find_products or find_collections for every product or collection the merchant names. Ids only come from these two tools. 4. create_function or update_function with the whole flow. Read the answer and fix any step listed with problems. 5. test_function with several carts in one call: just under and just over every threshold, and one that shouldn't qualify. Tell the merchant what each cart got. 6. Say the flow back as `reads_as` gives it, including what it combines with, give the open_in_shopify link, and ask before publish_function. Saving never changes checkout. Only publish_function, pause_function, delete_function and add_discount_codes do, and they need the publish permission. A function going live can be refused because the store's plan runs a set number at once. The refusal says so: offer to pause another one, or point to the Plans page. Don't pause anything unasked. A connection can make 120 calls a minute. An answer with status 429 means it made more: wait a minute, then carry on from where you were. ## Tools - get_store: See which store this is - find_products: Find products - find_collections: Find collections - list_functions: List functions - get_function: Read a function - list_step_types: List step types - list_templates: List ready-made flows - get_template: Read a ready-made flow - create_function: Create a function (needs the draft permission) - update_function: Change a function's flow (needs the draft permission) - duplicate_function: Duplicate a function (needs the draft permission) - test_function: Test a function on sample carts - publish_function: Publish a function (needs the publish permission) - pause_function: Pause a function (needs the publish permission) - delete_function: Delete a function (needs the publish permission) - list_discount_codes: See a discount's bulk codes - add_discount_codes: Add discount codes in bulk (needs the publish permission) ## For scripts The same operations over HTTPS: https://functions.otherwise.run/api/v1, described at https://functions.otherwise.run/api/openapi.json. It takes a token from the Agents page.