{"get_platform_info":{"name":"Loyal Spark","chain":"Base L2","chain_id":8453,"builder_code":"bc_wdmnog7m","token_standards":["B20","ERC-20"],"default_token_standard":"b20","features":["loyalty_programs","rewards","marketplace","tiers","referrals","vouchers","analytics"],"api_docs":"https://loyalspark.online/api-docs"},"protocol":"mcp-streamable-http","how_to_call":"MCP JSON-RPC uses POST https://api.loyalspark.online/loyalty-mcp with Content-Type: application/json and Accept: application/json, text/event-stream. Methods include initialize, tools/list, and tools/call. A GET whose Accept header includes text/event-stream opens the SSE stream. A GET without that header returns this JSON document. get_platform_info and tools/list do not need an API key.","tools":[{"name":"get_platform_info","description":"Loyal Spark protocol metadata on Base L2: chain id, supported features (programs, rewards, vouchers, P2P, MCP), and API docs URL.","input_schema":{"type":"object","properties":{}}},{"name":"get_my_profile","description":"Authenticated merchant agent profile: agent id, owner wallet, and API key scopes (read, mint, trade, manage_rewards, etc.).","input_schema":{"type":"object","properties":{}}},{"name":"list_loyalty_programs","description":"List ERC-20 loyalty programs owned by the authenticated merchant; optionally include expired programs.","input_schema":{"type":"object","properties":{"include_expired":{"type":"boolean","description":"When true, include programs with status expired."}}}},{"name":"create_loyalty_program","description":"Build factory calldata to deploy a new B20 loyalty token on Base (default token_standard b20: one tx, active at once; erc20 = legacy factory plus activate). Submit the tx from the merchant or agent wallet.","input_schema":{"type":"object","properties":{"name":{"type":"string","description":"Program display name (max 50 characters)."},"symbol":{"type":"string","description":"Token symbol (2–5 characters)."},"expiration_days":{"type":"number","description":"Program lifetime in days (default 365)."},"token_standard":{"type":"string","enum":["b20","erc20"],"default":"b20","description":"b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate_loyalty_program."},"agent_wallet_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"(B20) Extra wallet granted MINT_ROLE in the deploy tx. Default: the agent's CDP wallet."},"extra_minters":{"type":"array","items":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"EVM address on Base mainnet (eip155:8453)."},"description":"(B20) More addresses granted MINT_ROLE in the same deploy tx."}},"required":["name","symbol"]}},{"name":"register_loyalty_program","description":"Register an already-deployed loyalty token in Loyal Spark (links on-chain contract to merchant dashboard).","input_schema":{"type":"object","properties":{"name":{"type":"string","description":"Program display name."},"symbol":{"type":"string","description":"Token symbol."},"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Deployed loyalty ERC-20 contract on Base."}},"required":["name","symbol","token_address"]}},{"name":"activate_loyalty_program","description":"Build activation calldata for an inactive loyalty program (on-chain activate + DB status).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."}},"required":["token_address"]}},{"name":"update_program_status","description":"Update loyalty program status in the database (active, paused, expired, cancelled).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"status":{"type":"string","enum":["active","paused","expired","cancelled"],"description":"New program status."}},"required":["token_address","status"]}},{"name":"update_program_config","description":"Update program economics: cashback rate, points per dollar, and related merchant settings.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"cashback_rate":{"type":"number","description":"Cashback percentage of purchase amount (0–100)."},"points_per_dollar":{"type":"number","description":"Loyalty points earned per USD spent."}},"required":["token_address"],"anyOf":[{"required":["cashback_rate"]},{"required":["points_per_dollar"]}]}},{"name":"list_rewards","description":"List redeemable rewards configured for a loyalty program (name, cost in tokens, active flag).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."}},"required":["token_address"]}},{"name":"create_reward","description":"Create a new redeemable reward (customer pays token cost on-chain, then redeems for a voucher).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"name":{"type":"string","description":"Reward title shown to customers."},"description":{"type":"string","description":"Optional reward description."},"cost":{"type":"number","description":"Token amount required to redeem (minimum 1)."}},"required":["token_address","name","cost"]}},{"name":"mint_loyalty_tokens","description":"Fee-first mint calls[] (protocol fee first, then recipient) + fee_obligation_id. Accepts 0x Base wallet or customer email in recipient_address (or recipient_email). Confirm with confirm_mint_fee.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"recipient_address":{"type":"string","description":"Customer 0x wallet or email (preferred)."},"recipient":{"type":"string","description":"Legacy alias for recipient_address."},"recipient_email":{"type":"string","description":"Customer email to resolve to wallet."},"amount":{"type":"number","description":"Whole-token amount to mint (human units, not wei)."}},"required":["token_address","amount"],"anyOf":[{"required":["recipient_address"]},{"required":["recipient"]},{"required":["recipient_email"]}]}},{"name":"transfer_loyalty_tokens","description":"Build B20 token transfer calldata (ERC-20 compatible) to send loyalty tokens from the merchant or agent wallet to any address.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"to":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Recipient wallet address."},"to_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Alias for to (same as REST to_address)."},"amount":{"type":"number","description":"Whole-token amount to transfer."}},"required":["token_address","amount"],"anyOf":[{"required":["to"]},{"required":["to_address"]}]}},{"name":"earn_points","description":"Calculate and mint loyalty tokens from a purchase amount using the program cashback rate (earn / cashback flow).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"customer_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Customer wallet to credit."},"purchase_amount":{"type":"number","description":"Purchase total in USD (fiat units)."},"cashback_rate":{"type":"number","description":"Optional override of program cashback % (0–100)."}},"required":["token_address","customer_address","purchase_amount"]}},{"name":"get_token_balance","description":"Read a customer's loyalty token balance and tier level for a specific program.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"customer_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Customer wallet to query."}},"required":["token_address","customer_address"]}},{"name":"get_program_analytics","description":"Aggregate program analytics: holders, mint volume, redemptions, and tier distribution for a merchant.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."}},"required":["token_address"]}},{"name":"list_marketplace_offers","description":"List open P2P token-swap offers for a loyalty program (peer-to-peer marketplace).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Optional. When set, only offers that give or ask for this token."}}}},{"name":"redeem_reward","description":"Redeem a reward for an active voucher after the customer paid the token cost on-chain (requires transfer tx hash).","input_schema":{"type":"object","properties":{"reward_id":{"type":"string","format":"uuid","description":"Reward UUID from list_rewards."},"customer_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Customer wallet that paid the token cost."},"transaction_hash":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"On-chain transfer tx proving token payment."}},"required":["reward_id","customer_address","transaction_hash"]}},{"name":"use_voucher","description":"Mark an active voucher as used at checkout (merchant scans code or voucher id).","input_schema":{"type":"object","properties":{"voucher_code":{"type":"string","description":"Voucher code (LOYAL-XXXX-XXXX)."},"code":{"type":"string","description":"Alias of voucher_code."},"voucher_id":{"type":"string","format":"uuid","description":"Voucher UUID (alternative to code)."}},"anyOf":[{"required":["voucher_code"]},{"required":["code"]},{"required":["voucher_id"]}]}},{"name":"check_voucher_status","description":"Look up voucher status (active, used, expired) by human-readable code or internal id.","input_schema":{"type":"object","properties":{"code":{"type":"string","description":"Voucher code (LOYAL-XXXX-XXXX). Preferred."},"voucher_id":{"type":"string","format":"uuid","description":"Voucher UUID (alternative to code)."},"voucher_code":{"type":"string","description":"Alias of code."}},"anyOf":[{"required":["code"]},{"required":["voucher_id"]},{"required":["voucher_code"]}]}},{"name":"create_personalized_offer","description":"Create a targeted retention P2P or bonus offer for a specific customer wallet.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"customer_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Target customer wallet."},"title":{"type":"string","description":"Offer title shown to the customer."}},"required":["token_address","customer_address","title"]}},{"name":"update_reward_status","description":"Activate or deactivate a reward without deleting it (controls visibility in customer apps).","input_schema":{"type":"object","properties":{"reward_id":{"type":"string","format":"uuid","description":"Reward UUID."},"is_active":{"type":"boolean","description":"True to show reward; false to hide."}},"required":["reward_id","is_active"]}},{"name":"send_report","description":"Submit a structured AI agent report to the merchant dashboard (insights, alerts, action items).","input_schema":{"type":"object","properties":{"agent_role":{"type":"string","description":"Agent persona label (e.g. analyst, support)."},"report_type":{"type":"string","enum":["seo_audit","audit","growth_idea","data_report","anomaly","task","recommendation","weekly_report"],"description":"Report category; other values get a 400 listing the allowed ones (not charged)."},"title":{"type":"string","description":"Short report headline."},"content":{"type":"string","description":"Markdown or plain-text report body."},"priority":{"type":"string","enum":["low","medium","high"],"description":"Merchant inbox priority."},"action_items":{"type":"array","items":{"type":"string"},"description":"Suggested follow-up tasks."}},"required":["agent_role","report_type","title","content"]}},{"name":"list_my_reports","description":"List AI agent reports previously submitted by this merchant agent.","input_schema":{"type":"object","properties":{}}},{"name":"update_report_status","description":"Update merchant workflow status on an agent report (open, in_progress, resolved).","input_schema":{"type":"object","properties":{"report_id":{"type":"string","format":"uuid","description":"Report UUID."},"status":{"type":"string","description":"New status value."}},"required":["report_id","status"]}},{"name":"delete_report","description":"Permanently delete an agent report from the merchant dashboard.","input_schema":{"type":"object","properties":{"report_id":{"type":"string","format":"uuid","description":"Report UUID."}},"required":["report_id"]}},{"name":"export_customers","description":"Export customer list with balances and tiers for a loyalty program (CSV-ready JSON).","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."}},"required":["token_address"]}},{"name":"create_gift_certificate","description":"Issue gift or welcome certificates (LOYAL-XXXXXX); single code or batch up to 100 per call.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Loyalty program token contract."},"usd_amount":{"type":"number","description":"Face value in USD for the certificate."},"points_per_dollar":{"type":"number","description":"Conversion rate when minting tokens."},"max_redemption_percent":{"type":"number","description":"Max % of order payable with certificate."},"title":{"type":"string","description":"Certificate title for UI."},"description":{"type":"string","description":"Certificate description for UI."},"expires_in_days":{"type":"number","description":"Validity period from creation."},"image_url":{"type":"string","description":"Optional image URL for wallet / email."},"quantity":{"type":"number","description":"Batch size (1–100, default 1)."}},"required":["token_address","usd_amount"]}},{"name":"list_gift_certificates","description":"List gift certificates issued by the authenticated merchant with optional status filter.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Filter by program token."},"status":{"type":"string","enum":["active","pending_mint","redeemed","revoked","expired"],"description":"Filter by certificate lifecycle status."},"limit":{"type":"number","description":"Max rows to return (default 50)."}}}},{"name":"revoke_gift_certificate","description":"Revoke an active gift certificate so it can no longer be claimed (active -> revoked).","input_schema":{"type":"object","properties":{"certificate_id":{"type":"string","format":"uuid","description":"Gift certificate UUID."}},"required":["certificate_id"]}},{"name":"mark_gift_certificate_minted","description":"Finalize a claimed certificate after on-chain mint (pending_mint -> redeemed); requires mint tx hash.","input_schema":{"type":"object","properties":{"certificate_id":{"type":"string","format":"uuid","description":"Gift certificate UUID."},"transaction_hash":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"On-chain mint transaction hash."}},"required":["certificate_id","transaction_hash"]}},{"name":"generate_program_defaults","description":"Autonomous planner: propose program name, token symbol, cashback economics, and starter rewards from merchant business context. Use before create_loyalty_program when the agent has no explicit name/symbol.","input_schema":{"type":"object","properties":{"business_name":{"type":"string","description":"Merchant brand or storefront name."},"category":{"type":"string","description":"Business category (cafe, retail, beauty, fitness, etc.)."},"description":{"type":"string","description":"Short description of what the business sells."},"locale":{"type":"string","description":"Optional BCP-47 locale hint (e.g. en-US)."},"preferred_style":{"type":"string","description":"Optional tone hint: modern, classic, playful."},"target_audience":{"type":"string","description":"Optional audience descriptor."}}}},{"name":"get_program_workflow_status","description":"Autonomous status planner: returns the current merchant program lifecycle step and the machine-readable next_actions[] so an agent can self-orchestrate create -> register -> activate -> rewards -> mint.","input_schema":{"type":"object","properties":{"token_address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Optional loyalty token address. When omitted, uses the most recent program owned by the agent."}}}},{"name":"confirm_mint_fee","description":"Settle the protocol fee mint so a recipient balance can update. Schema: POST tools/list."},{"name":"list_mints","description":"List mint intents for this merchant. Schema: POST tools/list."},{"name":"list_fee_obligations","description":"List unpaid and settled protocol-fee obligations. Schema: POST tools/list."},{"name":"list_store_discount_codes","description":"List Shopify discount codes for this store. Schema: POST tools/list."},{"name":"update_store_discount_code","description":"Use or cancel a Shopify discount code. Schema: POST tools/list."},{"name":"set_store_sales_channel","description":"Set whether rewards are spent online, offline, or both. Schema: POST tools/list."},{"name":"bazaar_discover_resources","description":"Discover third-party x402 resources. Schema: POST tools/list."},{"name":"bazaar_discover_mcp_servers","description":"Search CDP Bazaar MCP (search_resources) for x402 tools. Schema: POST tools/list."},{"name":"bazaar_probe_x402","description":"Read x402 payment requirements for an https URL without paying. Schema: POST tools/list."},{"name":"bazaar_pay_and_call","description":"Pay an x402 URL and call it. Schema: POST tools/list."},{"name":"get_platform_stats","description":"Admin-only: global platform statistics. Needs the platform admin key; not sold pay-per-call. Schema: POST tools/list."},{"name":"cancel_stale_offers","description":"Admin-only: bulk-cancel stale P2P marketplace offers. Needs an admin key; not sold pay-per-call. Schema: POST tools/list."}],"tool_count":42,"admin_only_tool_count":2,"tools_list":{"method":"POST","url":"https://api.loyalspark.online/loyalty-mcp","headers":{"Content-Type":"application/json","Accept":"application/json, text/event-stream"},"body":{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}},"openapi":"https://loyalspark.online/openapi.json","auth":{"merchant_api_key":{"header":"x-api-key","prefix":"lsk_","instruction":"Send x-api-key: lsk_... (or Authorization: Bearer lsk_...) on merchant REST and MCP calls that change data or read your own account."},"recipient_api_key":{"header":"x-api-key","prefix":"rwk_","instruction":"Send x-api-key: rwk_... on recipient REST and recipient MCP calls for the holder wallet."},"siwe_registration":{"instruction":"An agent can register without a browser login. POST siwe-nonce, sign the EIP-4361 message (domain loyalspark.online, chain id 8453), then POST agent-register-siwe.","steps":[{"method":"POST","url":"https://api.loyalspark.online/siwe-nonce"},{"method":"POST","url":"https://api.loyalspark.online/agent-register-siwe"}]},"x402":{"asset":"USDC","chain":"Base","chain_id":8453,"price_range_usd":"$0.001–$0.01","instruction":"Permissionless pay-per-call. USDC on Base, $0.001–$0.01 per call. Pay $0.01 USDC at POST /x402-gateway/register-agent to get a full Free-plan lsk_ key (1 agent, 200 calls/mo, 1,000 mint tokens/mo, 1.25% fee, all 5 scopes) or a plan-scoped lsk_ key if on a Store/Agent plan.","register_agent_key":{"method":"POST","url":"https://api.loyalspark.online/x402-gateway/register-agent","price_usd":"0.01","plan":"free","scopes":["read","create_program","mint","trade","manage_rewards"],"api_calls_monthly":200,"max_mint_amount_monthly":1000,"transaction_fee_percent":1.25,"note":"Full Free-plan lsk_ key (not read-only) when the wallet has no Store Plan or Paid Agent Plan; plan-scoped otherwise. api_key is shown once: save it. Recover free via SIWE rotation (POST /siwe-nonce, then POST /agent-register-siwe with the same wallet and name)."},"mcp_tool_url":"https://api.loyalspark.online/x402-gateway/mcp-tools/<tool_name>","recipient_mcp_tool_url":"https://api.loyalspark.online/x402-gateway/recipient-mcp-tools/<tool_name>"}},"scopes":["read","mint","create_program","manage_rewards","trade"],"x402_tool_url":"https://api.loyalspark.online/x402-gateway/mcp-tools/<tool_name>"}