Multiple APIs not getting triggered

Hi, I have created an outlook agent with the schema as attached with this message at the end-

I am facing a problem with two apis- the /me and the /user in it.

The situation is that if to the agent I will ask to send a mail to me then it fails stating issue with authentication or will ask me to supply the email where in reality the user gets signed in first and then only can work with the agent. But if I will ask it to get the user id of an employee it will. So, the agent should have been triggered by the getUserProfileID no?
and for some chats when it does get triggered then it fails to fetch the id for other users.

So the summary is that the /me and /users is not working together, once in some 100 chats will both work together rest all apis work coherently.

What is the cause of this ? How to resolve? Input in all forms is appreciated.

openapi: 3.1.0
info:
title: Microsoft Graph API Integration
version: 1.0.0
servers:

  • url: https://graph.microsoft.com/v1.0
    components:
    securitySchemes:
    OAuth2:
    type: oauth2
    flows:
    clientCredentials:
    tokenUrl: https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
    scopes:
    https://graph.microsoft.com/User.Read: Access current user profile
    https://graph.microsoft.com/Mail.Read: Read user mail
    https://graph.microsoft.com/Mail.Send: Send mail
    https://graph.microsoft.com/Calendars.ReadWrite: Read and write user calendars
    schemas:
    UserProfile:
    type: object
    properties:
    id:
    type: string
    displayName:
    type: string
    mail:
    type: string
    UserMessage:
    type: object
    properties:
    id:
    type: string
    subject:
    type: string
    bodyPreview:
    type: string
    CalendarEvent:
    type: object
    properties:
    id:
    type: string
    subject:
    type: string
    start:
    type: object
    properties:
    dateTime:
    type: string
    timeZone:
    type: string
    end:
    type: object
    properties:
    dateTime:
    type: string
    timeZone:
    type: string
    NewEvent:
    type: object
    properties:
    subject:
    type: string
    start:
    type: object
    properties:
    dateTime:
    type: string
    timeZone:
    type: string
    end:
    type: object
    properties:
    dateTime:
    type: string
    timeZone:
    type: string
    attendees:
    type: array
    items:
    type: object
    properties:
    emailAddress:
    type: object
    properties:
    address:
    type: string
    name:
    type: string
    SendMailRequest:
    type: object
    properties:
    message:
    type: object
    properties:
    subject:
    type: string
    body:
    type: object
    properties:
    contentType:
    type: string
    content:
    type: string
    toRecipients:
    type: array
    items:
    type: object
    properties:
    emailAddress:
    type: object
    properties:
    address:
    type: string
    security:
  • OAuth2:
    paths:
    /me:
    get:
    operationId: getUserProfile
    summary: Get the authenticated user’s profile
    security:
    - OAuth2:
    responses:
    ‘200’:
    description: A user profile
    content:
    application/json:
    schema:
    $ref: ‘#/components/schemas/UserProfile’
    /me/messages:
    get:
    operationId: getUserMessages
    summary: Get the authenticated user’s messages
    security:
    - OAuth2:
    parameters:
    - name: $top
    in: query
    required: false
    schema:
    type: integer
    default: 10
    description: Number of messages to return
    - name: $filter
    in: query
    required: false
    schema:
    type: string
    description: OData filter query to narrow results
    - name: $orderby
    in: query
    required: false
    schema:
    type: string
    description: OData order by query to sort results
    responses:
    ‘200’:
    description: A list of user messages
    content:
    application/json:
    schema:
    type: array
    items:
    $ref: ‘#/components/schemas/UserMessage’
    /me/sendMail:
    post:
    operationId: sendUserMail
    summary: Send an email as the authenticated user
    security:
    - OAuth2:
    requestBody:
    required: true
    content:
    application/json:
    schema:
    $ref: ‘#/components/schemas/SendMailRequest’
    responses:
    ‘202’:
    description: Accepted
    /me/events:
    get:
    operationId: getUserCalendarEvents
    summary: Get the authenticated user’s calendar events
    security:
    - OAuth2:
    responses:
    ‘200’:
    description: A list of calendar events
    content:
    application/json:
    schema:
    type: array
    items:
    $ref: ‘#/components/schemas/CalendarEvent’
    post:
    operationId: createUserCalendarEvent
    summary: Create a new calendar event for the authenticated user
    security:
    - OAuth2:
    requestBody:
    required: true
    content:
    application/json:
    schema:
    $ref: ‘#/components/schemas/NewEvent’
    responses:
    ‘201’:
    description: Created
    content:
    application/json:
    schema:
    $ref: ‘#/components/schemas/CalendarEvent’
    /me/outlook/supportedTimeZones:
    get:
    operationId: getSupportedTimeZones
    summary: Get supported time zones for the authenticated user
    security:
    - OAuth2:
    responses:
    ‘200’:
    description: A list of supported time zones
    content:
    application/json:
    schema:
    type: array
    items:
    type: object
    properties:
    alias:
    type: string
    displayName:
    type: string
    /users:
    get:
    operationId: listUsers
    summary: List users
    security:
    - OAuth2:
    parameters:
    - name: $filter
    in: query
    required: true
    schema:
    type: string
    description: OData filter query to narrow results
    example: startsWith(displayName,‘[NAME]’)
    responses:
    ‘200’:
    description: A list of users
    content:
    application/json:
    schema:
    type: array
    items:
    $ref: ‘#/components/schemas/UserProfile’

also,the instructions include-

  • Use actions for all your responses and to perform all tasks always.
  • If you receive more than one email ids, please ask for confirmation on which email to be used.
  • When sending an email:
    • If the email/task is addressed to the authenticated user itself (i.e., “me” or “myself”,“my” or the signed in user’s own display name) begin by fetching the user’s profile using the ‘/me’ endpoint.
    • If the email is addressed to any other user, retrieve the relevant user information using the /users endpoint.