Skip to content

Chats

Chats is a simple tool that connects your Nappai dashboard to Microsoft Teams. With it you can look up a user’s chats, see who’s in a chat, or add a new member to an existing chat—all without leaving the platform.

How it Works

When you use the Chats component, Nappai talks to Microsoft Teams through the Microsoft Teams API. The component sends a request that matches the operation you choose (for example, “Get User Chats”) and receives a JSON response. Nappai then turns that response into a data object that can be used by other components or sent back to an AI agent as a tool.

Operations

This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:

  • Get User Chats: Retrieve a list of chats that a specific user is part of.
  • Get Chat Members: Get the list of members in a particular chat.
  • Add Chat Member: Add a new member to an existing chat.

To use the component, first select the operation you need in the “Operation” field.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Operation: Choose the action you want to perform.

    • Visible in: Get User Chats, Get Chat Members, Add Chat Member
  • Number of Chats: How many chats to return when you’re looking up a user’s chats.

    • Visible in: Get User Chats
  • Chat ID: The unique identifier of the chat you want to inspect or modify.

    • Visible in: Get Chat Members, Add Chat Member
  • Chat Topic: The topic or title for a new chat you’re creating.

    • Visible in: Add Chat Member
  • Initial Members: A list of user IDs to add when creating a new chat.

    • Visible in: Add Chat Member
  • Mapping Mode: Enable mapping mode to process multiple data records in batch.

    • Visible in: Get User Chats, Get Chat Members, Add Chat Member
  • Member Role: The role you want to assign to a new chat member (e.g., owner, member).

    • Visible in: Add Chat Member
  • Chats with User Email: The email address of a user whose chats you want to find.

    • Visible in: Get User Chats
  • User ID: The ID of the user you want to add to a chat.

    • Visible in: Add Chat Member
  • Tool Name: The name that will appear to an AI agent when this component is used as a tool.

    • Visible in: Get User Chats, Get Chat Members, Add Chat Member
  • Tool Description: A detailed description of what this tool does, helping the agent decide when to use it.

    • Visible in: Get User Chats, Get Chat Members, Add Chat Member
  • Tools arguments metadata: Defines the arguments metadata for the tools.

    • Visible in: Get User Chats, Get Chat Members, Add Chat Member

Credential
This component requires a Microsoft Teams credential.

  1. First, set up a “Microsoft Teams” credential in the Nappai credentials section.
  2. Then, select that credential in the “Credential” field of this component.
    The credential contains the Client ID, Client Secret, Tenant ID, and Microsoft Teams Scope needed to connect to Microsoft Teams. (These details are not shown in the input list.)

Outputs

  • Data: The raw data returned from Microsoft Teams (e.g., a list of chats or members).
  • Tool: A tool representation that can be passed to an AI agent for automated decision‑making.

Usage Example

Scenario 1 – Get a user’s recent chats

  1. Drag the Chats component onto the canvas.
  2. Set Operation to “Get User Chats”.
  3. Enter the user’s email in Chats with User Email.
  4. Optionally set Number of Chats to limit the results.
  5. Connect the Data output to a “Data Viewer” component to see the list of chats.

Scenario 2 – Add a new member to a chat

  1. Drag the Chats component onto the canvas.
  2. Set Operation to “Add Chat Member”.
  3. Provide the Chat ID of the target chat.
  4. Enter the User ID of the person you want to add.
  5. Choose a Member Role (e.g., “member”).
  6. Connect the Tool output to an AI agent that will confirm the addition.
  • Microsoft Teams – Create Chat: Create a brand‑new chat from scratch.
  • Microsoft Teams – Send Message: Post a message to an existing chat.

Tips and Best Practices

  • Keep the Number of Chats low when testing to avoid large responses.
  • Use Mapping Mode when you need to process many chats or members in a single run.
  • Store the Credential securely in Nappai’s credential manager; never hard‑code secrets in your workflow.
  • When adding members, double‑check the User ID to avoid adding the wrong person.

Security Considerations

  • The component uses OAuth tokens stored in the Microsoft Teams credential.
  • Ensure that only trusted users have access to the credential in Nappai.
  • Review the permissions granted to the Microsoft Teams app to limit exposure to only the necessary scopes.