Skip to main content

⚡ Add this skill

One command

Add the Autoplay Tidio Lyro skill for an existing Tidio Lyro AI support agent setup.
View the docs →

Agent onboarding

Fetch this skill when a customer already uses Tidio Lyro and wants its AI support agent to consume Autoplay live user activity.
View the skill →
Lyro (Tidio’s AI agent) pulls a user’s recent in-app activity on demand via a Lyro Action — a named API call that Lyro triggers when it needs context to answer. One Action, one API call to the Autoplay MCP server, and a user id wired in from the visitor session.

🎬 End-to-end walkthrough


🤖 Create the Action

In your Tidio dashboard, go to Lyro AI AgentActions+ Create ActionCreate from scratch.

Name

Give the Action a clear, descriptive name — Lyro uses the name as context for when to trigger it:

Instructions

The Instructions field tells Lyro when to call this Action. Fill it in with:

⚙️ Build the Action sequence

Click Create sequence in the Action sequence section. In the sequence builder, click the empty step and select API call from the right panel.

Configure the API call

Set up the API call to the Autoplay MCP server:
  • Method: POST
  • URL: https://mcp.autoplay.ai/mcp
Under Headers, add:
KeyValue
AuthorizationBearer YOUR_MCP_KEY
Content-Typeapplication/json
Under Body, paste:
Replace YOUR_PRODUCT_ID with your actual product id from your Autoplay dashboard. {{contact.user_id}} is a Tidio template variable — see Identity below for how to set it.

Save the response

After the API call step, add an Update session variable step. Save the activity data from the response so Lyro can reference it when composing its reply:
  • Variable name: activity
  • Value: the result.content[0].text field from the API response
Click Save and close.

🔐 Identity — wire the user id into the session

Lyro needs the current user’s stable id to pass as user_id in the API call. Set it from your frontend via the Tidio JS SDK after the user logs in:
The value you set must exactly equal the id your activity source uses:
How the pieces fit: your frontend identifies the user in your activity source → Autoplay stores activity under that id → your frontend also sets custom.user_id on the Tidio contact → Lyro reads {{contact.user_id}} and passes it in the API call → the buckets match.

💬 Update the Guidance instructions

Go to Lyro AI AgentBehaviorGuidanceCommunication StyleCustom. Add this to the instructions so Lyro knows how to use the activity data returned by the Action:

✅ Test the full loop

  1. Log in to your app as a test user — fires your activity source’s identify call and sets custom.user_id on the Tidio contact.
  2. Click around — visit a couple of pages, click a button, submit a form.
  3. Open the Tidio chat widget as that same logged-in user.
  4. Ask Lyro: “What have I been doing in the app recently?”
  5. Lyro triggers Get Live User Activity, calls the Autoplay MCP server, and answers with what you actually just did.
Common issues:
  • 401 / auth error → the Authorization header is missing or the token is wrong — revisit the API call headers above.
  • Empty activity returned → identity is working but that user has no recent activity yet. Browse around in your app first, then re-test.
  • Wrong user’s activity{{contact.user_id}} doesn’t match the id your activity source uses. Check both are identical.
“No recent activity” = identity mismatch. Confirm the same value in all three:
  1. the stable id your activity source identifies the user with (PostHog: posthog.identify(id), Amplitude: amplitude.setUserId(id)),
  2. the custom.user_id you set via tidioChatApi.setVisitorData,
  3. the {{contact.user_id}} referenced in the Action’s API call body.
If they don’t match, activity is stored under one key and fetched with another, and the lookup comes back empty.
Once Lyro is answering with real activity, jump into our Discord — we’ll confirm the Action is calling correctly and help you tune the trigger instructions.
Next: Step 2 — Define proactive triggers