web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Now, how do I use Clie...
Copilot Studio
Suggested Answer

Now, how do I use Client Tools?

(0) ShareShare
ReportReport
Posted on by 2
I read this article: https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-send-event-activities#using-client-tools
However, I can't seem to use it with my current Copilot Studio. Could you provide a minimal, usable theme configuration? Thanks.
Snipaste_2026-05-...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Suggested answer
    RaghavMishra Profile Picture
    72 on at

    Hi,

    The "Using client tools" section of the Send-event activities doc is correct, but it only works if a few prerequisites are in place. Here's the minimum end-to-end setup straight from Microsoft Learn:

    1. Confirm prerequisites

    • Client tools require the Web Chat / Direct Line embedding — they are not supported in the in-portal Test pane or in Microsoft Teams channel. See Send event activities → Using client tools.
    • Your agent must be published, and you must use a recent version of the Web Chat embed that includes the client-tools handshake.

    2. Define the client tool in your agent

    • In Copilot Studio → your agent → Topics, open a topic where you want to call the client.
    • Add a Send a custom event node (this is what Learn calls "send event activity").
    • Set the event name (e.g., openCustomerCard) and add the variables/parameters you want to pass to the client.
    • Reference: Send events to and from your agent.

    3. Minimal Web Chat host page

    • Use the canonical embed from the Learn quick-start. The key parts are: load Web Chat, get a Direct Line token, and listen for the event name you sent from the agent.
    • Reference: Embed your agent in a website using Web Chat.

    The key JavaScript pattern (inside your host page after loading Web Chat's CDN script) is:

    1. Fetch a Direct Line token from your token endpoint.
    2. Create the connection: WebChat.createDirectLine({ token }).
    3. Subscribe to directLine.activity$ and filter where a.type === 'event' and a.name matches the event name you sent from the topic. Read a.value for the payload.
    4. Render with WebChat.renderWebChat({ directLine }, container).

    4. Pass data back from the host to the agent (optional)

    • Use directLine.postActivity({ type: 'event', name: 'clientResult', value: {...} }) from the host page, and on the agent side add a Trigger on event topic that listens for the same event name. Reference: Event trigger.

    5. Common reasons "I can't get it to work"

    • You're testing inside the Copilot Studio canvas — switch to a Web Chat / published channel.
    • The Direct Line token endpoint isn't returning a valid token (check Network tab).
    • The event name in the topic doesn't exactly match the name your JS subscribes to (case sensitive).
    • You're using an older Web Chat CDN — use a recent pinned version.

    Microsoft Learn doesn't ship a "theme configuration" for client tools specifically — the theme refers to Web Chat styleOptions, which is a separate topic: Customize the default canvas.

    Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!

    Raghav Mishra — LinkedIn | PowerAI Labs

  • Suggested answer
    Vish WR Profile Picture
    3,432 on at
     
    Yes — that article refers to Client Tools using event activities between Copilot Studio and the client application.
    If it’s not working in your environment, here is a minimal working setup you can try.
     
    Option 1 — Static (InvokeClientTaskAction)
    Use this when the tool is known at design time:
     
     
    description: Retrieve slide content
    dialog:
      kind: TaskDialog
      action:
        kind: InvokeClientTaskAction
        clientActionInputSchema:
          kind: Record
          properties:
            page:
              displayName: Page Number
              type: Number
        clientActionResponseSchema:
          kind: Record
          properties:
            content:
              displayName: Slide Content
              type: String
     
    Option 2 — Dynamic (System.ClientPluginActions)
    Use this when tools are defined at runtime:
    - kind: SetVariable
      variable: System.ClientPluginActions
      value: |
        =[
          {
            Identifier: "GetSlideContent",
            Name: "GetSlideContent",
            Description: "Retrieve slide content",
            Response: {mode: "Generated"},
            Inputs: [
              {
                PropertyName: "page",
                IsRequired: true,
                Description: "Page number"
              }
            ],
            Outputs: [
              {
                PropertyName: "content",
                Description: "Slide content"
              }
            ]
          }
        ]
     
     

    Runtime flow


    {
      "type": "event",
      "name": "GetSlideContent",
      "replyToId": "xxx",
      "value": { "page": 5 }
    }
     
     

    Client responds:


    {
      "type": "event",
      "name": "GetSlideContent",
      "replyToId": "xxx",
      "value": { "content": "Slide text..." }
    }
     



     
  • CU27050645-1 Profile Picture
    2 on at
    Thanks. I'll give it a try.
  • Vish WR Profile Picture
    3,432 on at
    Wanted to check if you are able to resolve your problem? Let me know if you need any clarification 
     
     
    When replying, please don't forget to mention my userid so that it will be notified 
     
    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 455

#2
Vish WR Profile Picture

Vish WR 295

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 212 Super User 2026 Season 1

Last 30 days Overall leaderboard