{"id":66636,"plugin_id":"plugin_asdk_app_6a5104583be08191a0f29f096fe1aca6","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-10-28T12:27:43.679Z","digest":"31ab4f2a14c2a4a47efd46234e4ca93f9054f3f224e445677e8ce5b12d30c190","against":null,"payload":{"description":"Configures Vehicle Pricing V2 for an existing Motive dealer through api_docs and execute: enables canonical pricing, sets the document fee, builds New (Price, Payment, Lease) and Used (Price, Payment only — no Lease) pricing configs, publishes them, and checks the Payment Estimate app. Use when the user asks to set up, copy, or fix a pricing config, pricing stack, payment tab, lease tab, document fee, or canonical price mappings for a dealer.\n","included_files":[{"relative_path":"references/gotchas.md","size_in_bytes":7697},{"relative_path":"references/reference-config.md","size_in_bytes":13618}],"name":"pricing-config-setup","skill_md_contents":"---\nname: pricing-config-setup\ndescription: >\n  Configures Vehicle Pricing V2 for an existing Motive dealer through api_docs\n  and execute: enables canonical pricing, sets the document fee, builds New\n  (Price, Payment, Lease) and Used (Price, Payment only — no Lease) pricing\n  configs, publishes them, and checks the Payment Estimate app. Use when the\n  user asks to set up, copy, or fix a pricing config, pricing stack, payment\n  tab, lease tab, document fee, or canonical price mappings for a dealer.\n---\n\n# Pricing config configuration\n\nThis skill builds the standard Vehicle Pricing V2 pricing config for one dealer. You do all work with the MCP tools `api_docs`, `search_docs`, and `execute`. No MCP method creates a dealer. No MCP method installs the Payment Estimate app.\n\nThe procedure has seven phases. Each phase that writes data is one `execute` call. Do not divide a phase into more calls. Each call costs time.\n\nCopy the Price tab from a source dealer. Use [references/reference-config.md](references/reference-config.md) for dealer flags, final price rules, Payment and Lease tabs, and save shape. If the user does not name a source dealer, ask for one before Phase 5. Obey the rules in this skill when you adapt the copy.\n\n**Hard rule — no lease on Used.** The Lease tab (`tab_kind: \"lease\"`) is New-only. Used pricing configs get Price and Payment only. Never copy, create, or keep a Lease tab on a Used config. If a source Used config has a Lease tab, drop it.\n\nRead [references/gotchas.md](references/gotchas.md) before the first write.\n\n## Terms\n\nUse these words. Do not use a different word for the same object.\n\n- Pricing config: one saved price display for one vehicle condition. A dealer has one pricing config for New and one for Used.\n- Price tab: the cash price lines (`tab_kind` null/omitted).\n- Payment tab: the finance estimate lines (`tab_kind: \"finance\"`).\n- Lease tab: the lease estimate lines (`tab_kind: \"lease\"`). New configs only.\n- Canonical pricing: `v2_pricing_enabled` is true and `price_mapping_compute_enabled` is true. The stack field `canonical_pricing_enabled` is true only when both flags are true.\n- Canonical mapping: a `price_mappings` row. It writes a line result into a vehicle field (`msrp` or `price`).\n- Document fee: the dealer fee in `document_fee` (New) and `used_document_fee` (Used). The line label is `Documentary Service Fee`.\n- Hide condition: `visibility_conditions.expression`. When the expression is true, the site hides the element or the tab.\n- Change set: the audit group for the writes in one task.\n- Payment Estimate app: the Admin feature that fills `[[monthly_payment]]`, `[[apr]]`, `[[term]]`, and `[[money_down]]`. MCP cannot install it.\n\n## Values you need before you write\n\nGet these values from the user. If a value is missing, ask. Do not guess.\n\n1. The dealer id, or a dealer name that you can search.\n2. The document fee in dollars. Use one amount for New and for Used, unless the user gives two amounts.\n3. The final price rule. See \"Ask how the final price works\".\n\nOptional:\n\n- A source dealer id, only when the user says to copy the pricing config of another dealer.\n\n## Ask how the final price works\n\nPrice math is different for each dealer. Do not assume the rule. Ask the user these questions before Phase 5. Ask them one time, in one message.\n\n1. Is the final price the price from the feed (`price`, `discount_price`, or another feed field)? Which field?\n2. Does that feed price include the document fee?\n3. Must we add the document fee to that feed price?\n4. Must we ignore the feed price and compute the final price as MSRP minus OEM incentives?\n5. How does the dealer compute Dealer Discount? How does the dealer compute Market Adjustment?\n\nMap the answers to one rule in [references/reference-config.md](references/reference-config.md), section \"Final price rules\". If the answers do not match a rule, or if the answers conflict, stop and ask again. Do not write a formula that the user did not agree to.\n\nA user often names the discount as \"MSRP minus discount price\". The saved expression is `discount_price - msrp`. The sign is negative. This is the same rule.\n\nIf the user names a source dealer, read the Dealer Price formula of that dealer. Show the formula to the user. Ask the user to agree to it before you copy it.\n\n## Tools\n\n| Tool           | Use                                               |\n| -------------- | ------------------------------------------------- |\n| `api_docs`     | Read one method. This tool is not `ctx.api_docs`. |\n| `search_docs`  | Find a method by keyword.                         |\n| `execute`      | Send `async def run(ctx): ...`. No imports.       |\n| `report_issue` | Report a wrong doc or a broken `ctx` call.        |\n\nRead `api_docs` for a method the first time that you use it in a session. Read it again if a call fails with HTTP 422. Do not read every method before you start.\n\n`commit` is a short string. `commit=True` fails.\n\n## Change set rules\n\n- A read-only call does not open a change set.\n- The first write does not send `change_set_id`. It sends `commit=\"...\"`.\n- Each later write sends the same `change_set_id`.\n- One `commit` string for each phase.\n- If you also configure the inventory import for this dealer, use the same `change_set_id` for both skills.\n\n## Procedure\n\nCopy this checklist and mark each phase when it is done.\n\n```\n- [ ] Phase 1. Get the values from the user\n- [ ] Phase 2. Read the dealer and the pricing stack\n- [ ] Phase 3. Tell the user about the Payment Estimate app\n- [ ] Phase 4. Enable pricing and create the pricing config shells\n- [ ] Phase 5. Save the New draft and the Used draft\n- [ ] Phase 6. Publish and preview\n- [ ] Phase 7. Report\n```\n\nIf you also configure the inventory import for this dealer, do Phase 2 of both skills first. Then do the write phases of both skills. The two skills do not depend on each other. Do not wait for the inventory sync before you do Phase 4.\n\n### Phase 1. Get the values from the user\n\nGet the values in \"Values you need before you write\" and the answers in \"Ask how the final price works\". Ask for all missing values in one message.\n\n### Phase 2. Read the dealer and the pricing stack\n\nThis phase is one read-only `execute` call. Do not send `commit`.\n\n```python\nasync def run(ctx):\n    dealer, stack = await ctx.gather(\n        ctx.get_dealer(dealer_id),\n        ctx.get_pricing_stack(dealer_id),\n    )\n    configs = []\n    if dealer.get(\"v2_pricing_enabled\"):\n        listed = await ctx.list_pricing_configs(dealer_id)\n        for c in (listed.get(\"pricing_configs\") if isinstance(listed, dict) else listed) or []:\n            configs.append({\n                \"id\": c.get(\"id\"),\n                \"name\": c.get(\"name\"),\n                \"condition\": c.get(\"condition\"),\n                \"status\": c.get(\"status\"),\n            })\n    return {\n        \"dealer\": {\n            \"id\": dealer.get(\"id\"),\n            \"name\": dealer.get(\"name\"),\n            \"domain\": dealer.get(\"domain\"),\n            \"v2_pricing_enabled\": dealer.get(\"v2_pricing_enabled\"),\n            \"price_mapping_compute_enabled\": dealer.get(\"price_mapping_compute_enabled\"),\n            \"document_fee\": dealer.get(\"document_fee\"),\n            \"used_document_fee\": dealer.get(\"used_document_fee\"),\n            \"estimates_created\": dealer.get(\"estimates_created\"),\n            \"lease_pricing_enabled\": dealer.get(\"lease_pricing_enabled\"),\n            \"offer_logix_payments_enabled\": dealer.get(\"offer_logix_payments_enabled\"),\n        },\n        \"stack\": {\n            \"canonical_pricing_enabled\": stack.get(\"canonical_pricing_enabled\"),\n            \"doc_fees\": stack.get(\"doc_fees\"),\n            \"consumer_display_settings\": stack.get(\"consumer_display_settings\"),\n        },\n        \"configs\": configs,\n    }\n```\n\nRecord the dealer name. If the user gave a name, make sure that the id is correct before you write.\n\nRecord `estimates_created` and `offer_logix_payments_enabled` for Phase 3.\n\nRecord the id of an active New pricing config and an active Used pricing config, if they exist. Use those ids in Phase 4. Do not create a second pricing config for the same condition.\n\nDo not call `list_pricing_configs` when `v2_pricing_enabled` is false. The call fails with HTTP 403. The code above obeys this rule.\n\n### Phase 3. Tell the user about the Payment Estimate app\n\nThis phase has no `execute` call.\n\nIf `estimates_created` is false, give the user this text. Then continue. Do not stop the pricing work.\n\n> The Payment Estimate app is off. Open Admin. Open the dealer. Open Motive Tools. Find Payment Estimates. Select Install. Then set the New vehicle APR, term, and down payment. Motive MCP cannot install this app. The Payment tab stays empty until you install the app.\n\nIf `estimates_created` is false and `offer_logix_payments_enabled` is false, also tell the user that both sources of payment numbers are off.\n\nIf the app is already installed, use `get_estimate_app` / `update_estimate_app` to read or change APR, term, down, and `include_new` / `include_used` (setting either to `false` hides the classic VDP Finance tab for that condition). No `ctx` method creates/installs an estimate app. Rate sheets can be managed with `list_rate_sheets` / `create_rate_sheet` / `update_rate_sheet` / `delete_rate_sheet` (and the nested category/rate methods); see `api_docs` under Rate Sheets.\n\n### Phase 4. Enable pricing and create the pricing config shells\n\nThis phase is one `execute` call. Do not send `change_set_id`, unless the inventory skill opened a change set. Send `commit`.\n\nSet `NEW_DOC_FEE` and `USED_DOC_FEE` from the user. Set `NEW_ID` and `USED_ID` from Phase 2, or `None`.\n\n```python\nasync def run(ctx):\n    NEW_DOC_FEE = 569\n    USED_DOC_FEE = 589\n    NEW_ID = None\n    USED_ID = None\n\n    await ctx.update_dealer(\n        dealer_id,\n        v2_pricing_enabled=True,\n        price_mapping_compute_enabled=True,\n        show_pricing_config_on_consumer=True,\n        hide_v1_pricing_on_vdp=True,\n        detailed_vdp_pricing_enabled=True,\n        lease_pricing_enabled=True,\n        document_fee=NEW_DOC_FEE,\n        document_fee_copy=\"Documentary Service Fee\",\n        used_document_fee=USED_DOC_FEE,\n        used_document_fee_copy=\"Documentary Service Fee\",\n        market_adjustment_copy=\"Market Adjustment\",\n        dealer_discount_copy=\"Dealer Discount\",\n        accessories_copy=\"Dealer-Added Accessories\",\n        msrp_price_copy=\"MSRP\",\n        total_price_copy=\"Dealer Price\",\n        srp_price_copy=\"Our Price\",\n        ris_incentives_enabled=True,\n        oem_incentives_enabled=False,\n        hide_conditional_incentives=True,\n    )\n    await ctx.upsert_vehicle_card_settings(dealer_id, detailed_pricing_enabled=True)\n\n    if NEW_ID is None:\n        created = await ctx.create_pricing_config(dealer_id, name=\"New\", condition=\"New\")\n        NEW_ID = (created.get(\"pricing_config\") or created).get(\"id\")\n    if USED_ID is None:\n        created = await ctx.create_pricing_config(dealer_id, name=\"Used\", condition=\"Used\")\n        USED_ID = (created.get(\"pricing_config\") or created).get(\"id\")\n\n    stack = await ctx.get_pricing_stack(dealer_id)\n    display = stack.get(\"consumer_display_settings\") or {}\n    return {\n        \"new_id\": NEW_ID,\n        \"used_id\": USED_ID,\n        \"canonical_pricing_enabled\": stack.get(\"canonical_pricing_enabled\"),\n        \"v2_pricing_enabled\": stack.get(\"v2_pricing_enabled\"),\n        \"price_mapping_compute_enabled\": stack.get(\"price_mapping_compute_enabled\"),\n        \"doc_fees\": stack.get(\"doc_fees\"),\n        \"show_pricing_config_on_consumer\": display.get(\"show_pricing_config_on_consumer\"),\n        \"detailed_pricing_enabled_on_srp\": display.get(\"detailed_pricing_enabled_on_srp\"),\n    }\n```\n\n`commit=\"Enable canonical pricing, set document fees, create pricing config shells\"`\n\n`update_dealer` can give null for these fields. Use the values from `get_pricing_stack`, not the values from `update_dealer`. Make sure that the result has these values:\n\n- `canonical_pricing_enabled` is true\n- `v2_pricing_enabled` is true\n- `price_mapping_compute_enabled` is true\n- `doc_fees.new.amount` equals the New document fee\n- `doc_fees.used.amount` equals the Used document fee\n- `show_pricing_config_on_consumer` is true\n- `detailed_pricing_enabled_on_srp` is true\n\nRecord `change_set_id`, `new_id`, and `used_id`.\n\n`condition` cannot change after create. A new shell has status `pending` and no elements.\n\n### Phase 5. Save the New draft and the Used draft\n\nThis phase is one `execute` call. Send the `change_set_id`. Send `commit`.\n\nCopy the Price tab from the source dealer. For New, build Payment and Lease tabs from [references/reference-config.md](references/reference-config.md). For Used, build Payment only — do not build a Lease tab. Put the New document fee in the New disclaimer text. Put the Used document fee in the Used disclaimer text. Adapt the Dealer Price, Dealer Discount, and Market Adjustment formulas to match the rule that the user agreed to (see \"Final price rules\" in reference-config.md). Do not keep the source formulas when the user gave a different rule.\n\nCall `save_pricing_config` two times in the same script: one time for New, one time for Used.\n\n```python\nasync def run(ctx):\n    new_tabs = [...]      # Price + Payment + Lease from reference-config.md\n    new_mappings = [...]  # from source dealer Price tab, adapted for target\n    used_tabs = [...]     # Price + Payment only — no Lease\n    used_mappings = [...]\n\n    new_saved = await ctx.save_pricing_config(\n        dealer_id, new_id, tabs=new_tabs, price_mappings=new_mappings\n    )\n    used_saved = await ctx.save_pricing_config(\n        dealer_id, used_id, tabs=used_tabs, price_mappings=used_mappings\n    )\n    new_cfg = new_saved.get(\"pricing_config\") or new_saved\n    used_cfg = used_saved.get(\"pricing_config\") or used_saved\n    return {\n        \"new_tabs\": [t.get(\"name\") for t in new_cfg.get(\"tabs\") or []],\n        \"used_tabs\": [t.get(\"name\") for t in used_cfg.get(\"tabs\") or []],\n    }\n```\n\n`commit=\"Save New and Used pricing drafts\"`\n\nRules for the save:\n\n- Send `tabs`. Do not send flat `pricing_elements`.\n- Send every tab that must remain. A save replaces the draft tabs.\n- A new tab and a new element use `isNew: true` and a temp id of `900001` or more.\n- An element that exists keeps its real id. Do not set `isNew` on it.\n- Use different temp ids for the New tabs and the Used tabs. The reference file gives the ids.\n- Do not use `update_pricing_config_draft`. It makes the pricing config one Price tab.\n- Put the canonical mappings on the save. See the reference file.\n- The Payment terms line and the disclaimer line use `appearance.value.whitespace` = `\"normal\"`.\n- The terms line uses `containerHeight` = `\"20\"`.\n- Put a `PricingDivider` directly before the disclaimer line.\n\nMake sure that `new_tabs` lists `Price`, `Payment`, and `Lease`. Make sure that\n`used_tabs` lists only `Price` and `Payment` — never `Lease`.\n\n### Phase 6. Publish and preview\n\nThis phase is one `execute` call. Send the `change_set_id`. Send `commit`.\n\nSet `SAMPLE_VIN` to a VIN from the inventory. If the inventory is empty, use a VIN from the vendor file.\n\n```python\nasync def run(ctx):\n    SAMPLE_VIN = \"1FTEW2LP4TKE78729\"\n\n    new_pub = await ctx.publish_pricing_config(dealer_id, new_id)\n    used_pub = await ctx.publish_pricing_config(dealer_id, used_id)\n\n    inv = await ctx.search_inventory(dealer_id, condition=\"new\", hits_per_page=1)\n    vehicles = inv.get(\"vehicles\") or []\n    vin = vehicles[0].get(\"vin\") if vehicles else SAMPLE_VIN\n\n    preview = await ctx.preview_pricing_display(\n        dealer_id,\n        vin,\n        car_condition=\"New\",\n        feed_msrp=45000,\n        feed_discount_price=43000,\n        feed_equipment_price=1200,\n    )\n    data = (preview or {}).get(\"pricing_display_data\") or {}\n    tab_names = []\n    price_lines = []\n    for tab in data.get(\"tabs\") or []:\n        tab_names.append(tab.get(\"name\"))\n        if tab.get(\"name\") == \"Price\":\n            for el in tab.get(\"elements\") or []:\n                price_lines.append({\n                    \"label\": el.get(\"label\"),\n                    \"computed_amount\": el.get(\"computed_amount\"),\n                })\n    return {\n        \"new_enqueued\": new_pub.get(\"enqueued\"),\n        \"used_enqueued\": used_pub.get(\"enqueued\"),\n        \"new_status\": (new_pub.get(\"pricing_config\") or {}).get(\"status\"),\n        \"used_status\": (used_pub.get(\"pricing_config\") or {}).get(\"status\"),\n        \"nb_hits\": inv.get(\"nb_hits\"),\n        \"vin\": vin,\n        \"tab_names\": tab_names,\n        \"price_lines\": price_lines,\n    }\n```\n\n`commit=\"Publish New and Used pricing configs\"`\n\nMake sure that the result has these values:\n\n- `new_enqueued` and `used_enqueued` are true\n- `new_status` and `used_status` are `active`\n- `tab_names` has `Price` and `Payment`\n- `price_lines` has MSRP, Documentary Service Fee, and Dealer Price\n- The Dealer Price amount matches the formula for the rule. Under Rule A with a fee of 569, the amount is 44769.\n\nThe preview result puts the tabs in `pricing_display_data.tabs`. Each line has `computed_amount`. Do not look for top-level `tabs` or for `computed_value` in the preview result.\n\nThe Lease tab is not in the preview when `lease_payment` is 0. That result is correct.\n\nPublish replaces each temp id with a real id. The canonical mappings change to those real ids. That change is correct.\n\n`search_inventory` takes `condition=\"new\"`. It does not take `car_condition`. `preview_pricing_display` takes `car_condition=\"New\"`.\n\nInventory search can show an empty `pricing_display_data` for a short time after publish. The preview is the check. The search index updates after the refresh job.\n\n### Phase 7. Report\n\nGive the user these values:\n\n- Dealer id and dealer name\n- One vehicle URL (https://<dealerDomain>/inventory/<VIN>)\n- The New document fee and the Used document fee\n- The final price rule and the Dealer Price formula that you published\n- Canonical pricing is on\n- The Payment Estimate app is on or off\n- The Admin steps from Phase 3, when the app is off\n- Change set id\n\n## Errors\n\n| Error                                         | Cause                                  | Action                                                      |\n| --------------------------------------------- | -------------------------------------- | ----------------------------------------------------------- |\n| HTTP 403 on `list_pricing_configs`            | Vehicle Pricing V2 is off              | Do not call it. Phase 4 enables V2.                         |\n| HTTP 403 on `preview_pricing_display`         | `v2_pricing_enabled` is false          | Do Phase 4.                                                 |\n| `unexpected keyword argument 'car_condition'` | Wrong search argument                  | Use `condition=\"new\"` or `condition=\"used\"`.                |\n| `name 'next' is not defined`                  | The sandbox blocks that builtin        | Use a `for` loop.                                           |\n| `Dunder attribute access is not allowed`      | The sandbox blocks `__*` attributes    | Do not use `__name__`, `__dict__`, or similar.              |\n| `update_dealer` gives null flags              | The write result omits them            | Read `get_pricing_stack` in the same call.                  |\n| Empty Payment amounts on the site             | The Payment Estimate app is off        | Give the user the Phase 3 steps.                            |\n| One Price tab after a draft edit              | `update_pricing_config_draft` was used | Save again with full `tabs`.                                |\n| HTTP 422 on the second save in Phase 5        | Bad tab or element shape               | Correct the Used tabs. Save Used alone with the change set. |\n\nIf Phase 4 fails after some writes, the change set has those writes. Do not send the whole phase again without change. Set `NEW_ID` and `USED_ID` to the shells that exist. Then send the phase again with the `change_set_id`.\n\nMore failures are in [references/gotchas.md](references/gotchas.md).\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}