Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1007 B
Raw Blame
import { createAction } from '@activepieces/pieces-framework';

import { microsoftTeamsAuth } from '../../../auth';
import { microsoftTeamsClient } from '../../../common/client';
import { microsoftTeamsGetMyPresenceOutputSchema } from '../../../output-schemas';

export const getMyPresence = createAction({
  auth: microsoftTeamsAuth,
  name: 'microsoft_teams_get_my_presence',
  outputSchema: microsoftTeamsGetMyPresenceOutputSchema,
  displayName: 'Get My Presence',
  description: "Gets the signed-in user's Teams presence.",
  audience: 'ai',
  classification: 'READ',
  aiMetadata: {
    description:
      "Gets the signed-in user's current Teams availability (for example Available, Busy, Away), activity and status message. Use Get User Presence for someone else.",
    idempotent: true,
  },
  props: {},
  async run(context) {
    const client = microsoftTeamsClient.create({ auth: context.auth });
    return await microsoftTeamsClient.withRetry(() => client.api('/me/presence').get());
  },
});