@softeria/ms-365-mcp-server
Version:
A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API
712 lines • 694 kB
JavaScript
import { makeApi, Zodios } from "./hack.js";
import { z } from "zod";
const microsoft_graph_chatType = z.enum(["oneOnOne", "group", "meeting", "unknownFutureValue"]);
const microsoft_graph_migrationMode = z.enum(["inProgress", "completed", "unknownFutureValue"]);
const microsoft_graph_teamworkUserIdentityType = z.enum([
"aadUser",
"onPremiseAadUser",
"anonymousGuest",
"federatedUser",
"personalMicrosoftAccountUser",
"skypeUser",
"phoneUser",
"unknownFutureValue",
"emailUser"
]);
const microsoft_graph_teamworkUserIdentity = z.object({
displayName: z.string().describe(
"The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta."
).nullish(),
id: z.string().describe(
"Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review."
).nullish(),
userIdentityType: microsoft_graph_teamworkUserIdentityType.optional()
}).passthrough();
const microsoft_graph_teamworkOnlineMeetingInfo = z.object({
calendarEventId: z.string().describe("The identifier of the calendar event associated with the meeting.").nullish(),
joinWebUrl: z.string().describe("The URL that users click to join or uniquely identify the meeting.").nullish(),
organizer: microsoft_graph_teamworkUserIdentity.optional()
}).passthrough();
const microsoft_graph_chatViewpoint = z.object({
isHidden: z.boolean().describe("Indicates whether the chat is hidden for the current user.").nullish(),
lastMessageReadDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Represents the dateTime up until which the current user has read chatMessages in a specific chat."
).nullish()
}).passthrough();
const microsoft_graph_teamsAppResourceSpecificPermissionType = z.enum([
"delegated",
"application",
"unknownFutureValue"
]);
const microsoft_graph_teamsAppResourceSpecificPermission = z.object({
permissionType: microsoft_graph_teamsAppResourceSpecificPermissionType.optional(),
permissionValue: z.string().describe("The name of the resource-specific permission.").nullish()
}).passthrough();
const microsoft_graph_teamsAppPermissionSet = z.object({
resourceSpecificPermissions: z.array(microsoft_graph_teamsAppResourceSpecificPermission).describe("A collection of resource-specific permissions.").optional()
}).passthrough();
const microsoft_graph_teamsAppDistributionMethod = z.enum([
"store",
"organization",
"sideloaded",
"unknownFutureValue"
]);
const microsoft_graph_teamsAppAuthorization = z.object({
clientAppId: z.string().describe("The registration ID of the Microsoft Entra app ID associated with the teamsApp.").nullish(),
requiredPermissionSet: microsoft_graph_teamsAppPermissionSet.optional()
}).passthrough();
const microsoft_graph_identity = z.object({
displayName: z.string().describe(
"The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta."
).nullish(),
id: z.string().describe(
"Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review."
).nullish()
}).passthrough();
const microsoft_graph_identitySet = z.object({
application: microsoft_graph_identity.optional(),
device: microsoft_graph_identity.optional(),
user: microsoft_graph_identity.optional()
}).passthrough();
const microsoft_graph_teamsAppPublishingState = z.enum([
"submitted",
"rejected",
"published",
"unknownFutureValue"
]);
const microsoft_graph_teamworkBot = z.object({ id: z.string().describe("The unique identifier for an entity. Read-only.").optional() }).passthrough();
const microsoft_graph_teamsAppDefinition = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
authorization: microsoft_graph_teamsAppAuthorization.optional(),
createdBy: microsoft_graph_identitySet.optional(),
description: z.string().describe("Verbose description of the application.").nullish(),
displayName: z.string().describe("The name of the app provided by the app developer.").nullish(),
lastModifiedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).nullish(),
publishingState: microsoft_graph_teamsAppPublishingState.optional(),
shortDescription: z.string().describe("Short description of the application.").nullish(),
teamsAppId: z.string().describe("The ID from the Teams app manifest.").nullish(),
version: z.string().describe("The version number of the application.").nullish(),
bot: microsoft_graph_teamworkBot.optional()
}).passthrough();
const microsoft_graph_teamsApp = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
displayName: z.string().describe(
"The name of the catalog app provided by the app developer in the Microsoft Teams zip app package."
).nullish(),
distributionMethod: microsoft_graph_teamsAppDistributionMethod.optional(),
externalId: z.string().describe(
"The ID of the catalog provided by the app developer in the Microsoft Teams zip app package."
).nullish(),
appDefinitions: z.array(microsoft_graph_teamsAppDefinition).describe("The details for each version of the app.").optional()
}).passthrough();
const microsoft_graph_teamsAppInstallation = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
consentedPermissionSet: microsoft_graph_teamsAppPermissionSet.optional(),
teamsApp: microsoft_graph_teamsApp.optional(),
teamsAppDefinition: microsoft_graph_teamsAppDefinition.optional()
}).passthrough();
const microsoft_graph_bodyType = z.enum(["text", "html"]);
const microsoft_graph_itemBody = z.object({
content: z.string().describe("The content of the item.").nullish(),
contentType: microsoft_graph_bodyType.optional()
}).passthrough();
const microsoft_graph_eventMessageDetail = z.object({}).passthrough();
const microsoft_graph_chatMessageFromIdentitySet = z.object({
application: microsoft_graph_identity.optional(),
device: microsoft_graph_identity.optional(),
user: microsoft_graph_identity.optional()
}).passthrough();
const microsoft_graph_chatMessageType = z.enum([
"message",
"chatEvent",
"typing",
"unknownFutureValue",
"systemEventMessage"
]);
const microsoft_graph_chatMessageInfo = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
body: microsoft_graph_itemBody.optional(),
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("Date time object representing the time at which message was created.").nullish(),
eventDetail: microsoft_graph_eventMessageDetail.optional(),
from: microsoft_graph_chatMessageFromIdentitySet.optional(),
isDeleted: z.boolean().describe("If set to true, the original message has been deleted.").nullish(),
messageType: microsoft_graph_chatMessageType.optional()
}).passthrough();
const microsoft_graph_conversationMember = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
displayName: z.string().describe("The display name of the user.").nullish(),
roles: z.array(z.string().nullable()).describe(
"The roles for that user. This property contains more qualifiers only when relevant - for example, if the member has owner privileges, the roles property contains owner as one of the values. Similarly, if the member is an in-tenant guest, the roles property contains guest as one of the values. A basic member shouldn't have any values specified in the roles property. An Out-of-tenant external member is assigned the owner role."
).optional(),
visibleHistoryStartDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The timestamp denoting how far back a conversation's history is shared with the conversation member. This property is settable only for members of a chat."
).nullish()
}).passthrough();
const microsoft_graph_chatMessageAttachment = z.object({
content: z.string().describe(
"The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive."
).nullish(),
contentType: z.string().describe(
"The media type of the content attachment. The possible values are: reference: The attachment is a link to another file. Populate the contentURL with the link to the object.forwardedMessageReference: The attachment is a reference to a forwarded message. Populate the content with the original message context.Any contentType that is supported by the Bot Framework's Attachment object.application/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header."
).nullish(),
contentUrl: z.string().describe("The URL for the content of the attachment.").nullish(),
id: z.string().describe("Read-only. The unique ID of the attachment.").nullish(),
name: z.string().describe("The name of the attachment.").nullish(),
teamsAppId: z.string().describe(
"The ID of the Teams app that is associated with the attachment. The property is used to attribute a Teams message card to the specified app."
).nullish(),
thumbnailUrl: z.string().describe(
"The URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user selects the image, the channel would open the document."
).nullish()
}).passthrough();
const microsoft_graph_channelIdentity = z.object({
channelId: z.string().describe("The identity of the channel in which the message was posted.").nullish(),
teamId: z.string().describe("The identity of the team in which the message was posted.").nullish()
}).passthrough();
const microsoft_graph_chatMessageImportance = z.enum([
"normal",
"high",
"urgent",
"unknownFutureValue"
]);
const microsoft_graph_teamworkConversationIdentityType = z.enum([
"team",
"channel",
"chat",
"unknownFutureValue"
]);
const microsoft_graph_teamworkConversationIdentity = z.object({
displayName: z.string().describe(
"The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta."
).nullish(),
id: z.string().describe(
"Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review."
).nullish(),
conversationIdentityType: microsoft_graph_teamworkConversationIdentityType.optional()
}).passthrough();
const microsoft_graph_chatMessageMentionedIdentitySet = z.object({
application: microsoft_graph_identity.optional(),
device: microsoft_graph_identity.optional(),
user: microsoft_graph_identity.optional(),
conversation: microsoft_graph_teamworkConversationIdentity.optional()
}).passthrough();
const microsoft_graph_chatMessageMention = z.object({
id: z.number().gte(-2147483648).lte(2147483647).describe(
"Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding <at id='{index}'> tag in the message body."
).nullish(),
mentioned: microsoft_graph_chatMessageMentionedIdentitySet.optional(),
mentionText: z.string().describe(
"String used to represent the mention. For example, a user's display name, a team name."
).nullish()
}).passthrough();
const microsoft_graph_chatMessageActions = z.enum([
"reactionAdded",
"reactionRemoved",
"actionUndefined",
"unknownFutureValue"
]);
const microsoft_graph_chatMessageReactionIdentitySet = z.object({
application: microsoft_graph_identity.optional(),
device: microsoft_graph_identity.optional(),
user: microsoft_graph_identity.optional()
}).passthrough();
const microsoft_graph_chatMessageReaction = z.object({
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z."
).optional(),
displayName: z.string().describe("The name of the reaction.").nullish(),
reactionContentUrl: z.string().describe("The hosted content URL for the custom reaction type.").nullish(),
reactionType: z.string().describe(
"The reaction type. Supported values include Unicode characters, custom, and some backward-compatible reaction types, such as like, angry, sad, laugh, heart, and surprised."
).optional(),
user: microsoft_graph_chatMessageReactionIdentitySet.optional()
}).passthrough();
const microsoft_graph_chatMessageHistoryItem = z.object({
actions: microsoft_graph_chatMessageActions.optional(),
modifiedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("The date and time when the message was modified.").optional(),
reaction: microsoft_graph_chatMessageReaction.optional()
}).passthrough();
const microsoft_graph_chatMessagePolicyViolationDlpActionTypes = z.enum([
"none",
"notifySender",
"blockAccess",
"blockAccessExternal"
]);
const microsoft_graph_chatMessagePolicyViolationPolicyTip = z.object({
complianceUrl: z.string().describe(
"The URL a user can visit to read about the data loss prevention policies for the organization. (ie, policies about what users shouldn't say in chats)"
).nullish(),
generalText: z.string().describe("Explanatory text shown to the sender of the message.").nullish(),
matchedConditionDescriptions: z.array(z.string().nullable()).describe(
"The list of improper data in the message that was detected by the data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and 'Social Security Number'."
).optional()
}).passthrough();
const microsoft_graph_chatMessagePolicyViolationUserActionTypes = z.enum([
"none",
"override",
"reportFalsePositive"
]);
const microsoft_graph_chatMessagePolicyViolationVerdictDetailsTypes = z.enum([
"none",
"allowFalsePositiveOverride",
"allowOverrideWithoutJustification",
"allowOverrideWithJustification"
]);
const microsoft_graph_chatMessagePolicyViolation = z.object({
dlpAction: microsoft_graph_chatMessagePolicyViolationDlpActionTypes.optional(),
justificationText: z.string().describe(
"Justification text provided by the sender of the message when overriding a policy violation."
).nullish(),
policyTip: microsoft_graph_chatMessagePolicyViolationPolicyTip.optional(),
userAction: microsoft_graph_chatMessagePolicyViolationUserActionTypes.optional(),
verdictDetails: microsoft_graph_chatMessagePolicyViolationVerdictDetailsTypes.optional()
}).passthrough();
const microsoft_graph_chatMessageHostedContent = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
contentBytes: z.string().describe("Write only. Bytes for the hosted content (such as images).").nullish(),
contentType: z.string().describe("Write only. Content type. such as image/png, image/jpg.").nullish()
}).passthrough();
const microsoft_graph_chatMessage = z.lazy(
() => z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
attachments: z.array(microsoft_graph_chatMessageAttachment).describe("References to attached objects like files, tabs, meetings etc.").optional(),
body: microsoft_graph_itemBody.optional(),
channelIdentity: microsoft_graph_channelIdentity.optional(),
chatId: z.string().describe("If the message was sent in a chat, represents the identity of the chat.").nullish(),
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("Timestamp of when the chat message was created.").nullish(),
deletedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Read only. Timestamp at which the chat message was deleted, or null if not deleted."
).nullish(),
etag: z.string().describe("Read-only. Version number of the chat message.").nullish(),
eventDetail: microsoft_graph_eventMessageDetail.optional(),
from: microsoft_graph_chatMessageFromIdentitySet.optional(),
importance: microsoft_graph_chatMessageImportance.optional(),
lastEditedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null."
).nullish(),
lastModifiedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed."
).nullish(),
locale: z.string().describe("Locale of the chat message set by the client. Always set to en-us.").optional(),
mentions: z.array(microsoft_graph_chatMessageMention).describe(
"List of entities mentioned in the chat message. Supported entities are: user, bot, team, channel, chat, and tag."
).optional(),
messageHistory: z.array(microsoft_graph_chatMessageHistoryItem).describe(
"List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message."
).optional(),
messageType: microsoft_graph_chatMessageType.optional(),
policyViolation: microsoft_graph_chatMessagePolicyViolation.optional(),
reactions: z.array(microsoft_graph_chatMessageReaction).describe("Reactions for this chat message (for example, Like).").optional(),
replyToId: z.string().describe(
"Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)"
).nullish(),
subject: z.string().describe("The subject of the chat message, in plaintext.").nullish(),
summary: z.string().describe(
"Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat."
).nullish(),
webUrl: z.string().describe("Read-only. Link to the message in Microsoft Teams.").nullish(),
hostedContents: z.array(microsoft_graph_chatMessageHostedContent).describe(
"Content in a message hosted by Microsoft Teams - for example, images or code snippets."
).optional(),
replies: z.array(microsoft_graph_chatMessage).describe("Replies for a specified message. Supports $expand for channel messages.").optional()
}).passthrough()
);
const microsoft_graph_resourceSpecificPermissionGrant = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
deletedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Date and time when this object was deleted. Always null when the object hasn't been deleted."
).nullish(),
clientAppId: z.string().describe(
"ID of the service principal of the Microsoft Entra app that has been granted access. Read-only."
).nullish(),
clientId: z.string().describe("ID of the Microsoft Entra app that has been granted access. Read-only.").nullish(),
permission: z.string().describe("The name of the resource-specific permission. Read-only.").nullish(),
permissionType: z.string().describe(
"The type of permission. The possible values are: Application, Delegated. Read-only."
).nullish(),
resourceAppId: z.string().describe("ID of the Microsoft Entra app that is hosting the resource. Read-only.").nullish()
}).passthrough();
const microsoft_graph_pinnedChatMessageInfo = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
message: microsoft_graph_chatMessage.optional()
}).passthrough();
const microsoft_graph_teamsTabConfiguration = z.object({
contentUrl: z.string().describe("Url used for rendering tab contents in Teams. Required.").nullish(),
entityId: z.string().describe("Identifier for the entity hosted by the tab provider.").nullish(),
removeUrl: z.string().describe("Url called by Teams client when a Tab is removed using the Teams Client.").nullish(),
websiteUrl: z.string().describe("Url for showing tab contents outside of Teams.").nullish()
}).passthrough();
const microsoft_graph_teamsTab = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
configuration: microsoft_graph_teamsTabConfiguration.optional(),
displayName: z.string().describe("Name of the tab.").nullish(),
webUrl: z.string().describe("Deep link URL of the tab instance. Read-only.").nullish(),
teamsApp: microsoft_graph_teamsApp.optional()
}).passthrough();
const microsoft_graph_chat = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
chatType: microsoft_graph_chatType.optional(),
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("Date and time at which the chat was created. Read-only.").nullish(),
isHiddenForAllMembers: z.boolean().describe("Indicates whether the chat is hidden for all its members. Read-only.").nullish(),
lastUpdatedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Date and time at which the chat was renamed or the list of members was last changed. Read-only."
).nullish(),
migrationMode: microsoft_graph_migrationMode.optional(),
onlineMeetingInfo: microsoft_graph_teamworkOnlineMeetingInfo.optional(),
originalCreatedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Timestamp of the original creation time for the chat. The value is null if the chat never entered migration mode."
).nullish(),
tenantId: z.string().describe("The identifier of the tenant in which the chat was created. Read-only.").nullish(),
topic: z.string().describe("(Optional) Subject or topic for the chat. Only available for group chats.").nullish(),
viewpoint: microsoft_graph_chatViewpoint.optional(),
webUrl: z.string().describe(
"The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only."
).nullish(),
installedApps: z.array(microsoft_graph_teamsAppInstallation).describe("A collection of all the apps in the chat. Nullable.").optional(),
lastMessagePreview: microsoft_graph_chatMessageInfo.optional(),
members: z.array(microsoft_graph_conversationMember).describe("A collection of all the members in the chat. Nullable.").optional(),
messages: z.array(microsoft_graph_chatMessage).describe("A collection of all the messages in the chat. Nullable.").optional(),
permissionGrants: z.array(microsoft_graph_resourceSpecificPermissionGrant).describe("A collection of permissions granted to apps for the chat.").optional(),
pinnedMessages: z.array(microsoft_graph_pinnedChatMessageInfo).describe("A collection of all the pinned messages in the chat. Nullable.").optional(),
tabs: z.array(microsoft_graph_teamsTab).describe("A collection of all the tabs in the chat. Nullable.").optional()
}).passthrough();
const microsoft_graph_ODataErrors_ErrorDetails = z.object({ code: z.string(), message: z.string(), target: z.string().nullish() }).passthrough();
const microsoft_graph_ODataErrors_InnerError = z.object({
"request-id": z.string().describe("Request Id as tracked internally by the service").nullish(),
"client-request-id": z.string().describe("Client request Id as sent by the client application.").nullish(),
date: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("Date when the error occured.").nullish()
}).passthrough();
const microsoft_graph_ODataErrors_MainError = z.object({
code: z.string(),
message: z.string(),
target: z.string().nullish(),
details: z.array(microsoft_graph_ODataErrors_ErrorDetails).optional(),
innerError: microsoft_graph_ODataErrors_InnerError.optional()
}).passthrough();
const microsoft_graph_ODataErrors_ODataError = z.object({ error: microsoft_graph_ODataErrors_MainError }).passthrough();
const microsoft_graph_conversationMemberCollectionResponse = z.object({
"@odata.count": z.number().int().nullable(),
"@odata.nextLink": z.string().nullable(),
value: z.array(microsoft_graph_conversationMember)
}).partial().passthrough();
const microsoft_graph_chatMessageCollectionResponse = z.object({
"@odata.count": z.number().int().nullable(),
"@odata.nextLink": z.string().nullable(),
value: z.array(microsoft_graph_chatMessage)
}).partial().passthrough();
const microsoft_graph_chatMessageHostedContentCollectionResponse = z.object({
"@odata.count": z.number().int().nullable(),
"@odata.nextLink": z.string().nullable(),
value: z.array(microsoft_graph_chatMessageHostedContent)
}).partial().passthrough();
const microsoft_graph_pinnedChatMessageInfoCollectionResponse = z.object({
"@odata.count": z.number().int().nullable(),
"@odata.nextLink": z.string().nullable(),
value: z.array(microsoft_graph_pinnedChatMessageInfo)
}).partial().passthrough();
const get_presences_by_user_id_Body = z.object({ ids: z.array(z.string()) }).partial().passthrough();
const BaseCollectionPaginationCountResponse = z.object({ "@odata.count": z.number().int().nullable(), "@odata.nextLink": z.string().nullable() }).partial().passthrough();
const microsoft_graph_outOfOfficeSettings = z.object({
isOutOfOffice: z.boolean().describe(
"If true, either of the following is met:The current time falls within the out-of-office window configured in Outlook or Teams.An event marked as 'Show as Out of Office' appears on the user's calendar.Otherwise, false."
).nullish(),
message: z.string().describe(
"The out-of-office message configured by the user in the Outlook client (Automatic replies) or the Teams client (Schedule out of office)."
).nullish()
}).passthrough();
const microsoft_graph_dateTimeTimeZone = z.object({
dateTime: z.string().describe(
"A single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00:00.0000000)."
).optional(),
timeZone: z.string().describe(
"Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values."
).nullish()
}).passthrough();
const microsoft_graph_presenceStatusMessage = z.object({
expiryDateTime: microsoft_graph_dateTimeTimeZone.optional(),
message: microsoft_graph_itemBody.optional(),
publishedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Time in which the status message was published.Read-only.publishedDateTime isn't available when you request the presence of another user."
).nullish()
}).passthrough();
const microsoft_graph_workLocationSource = z.enum([
"none",
"manual",
"scheduled",
"automatic",
"unknownFutureValue"
]);
const microsoft_graph_workLocationType = z.enum([
"unspecified",
"office",
"remote",
"timeOff",
"unknownFutureValue"
]);
const microsoft_graph_userWorkLocation = z.object({
placeId: z.string().describe("Identifier of the place, if applicable.").nullish(),
source: microsoft_graph_workLocationSource.optional(),
workLocationType: microsoft_graph_workLocationType.optional()
}).passthrough();
const microsoft_graph_presence = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
activity: z.string().describe(
"The supplemental information to a user's availability. Possible values are available, away, beRightBack, busy, doNotDisturb, offline, outOfOffice, presenceUnknown."
).nullish(),
availability: z.string().describe(
"The base presence information for a user. Possible values are available, away, beRightBack, busy, doNotDisturb, focusing, inACall, inAMeeting, offline, presenting, presenceUnknown."
).nullish(),
outOfOfficeSettings: microsoft_graph_outOfOfficeSettings.optional(),
sequenceNumber: z.string().describe(
"The lexicographically sortable String stamp that represents the version of a presence object."
).nullish(),
statusMessage: microsoft_graph_presenceStatusMessage.optional(),
workLocation: microsoft_graph_userWorkLocation.optional()
}).passthrough();
const microsoft_graph_geoCoordinates = z.object({
altitude: z.number().describe(
"Optional. The altitude (height), in feet, above sea level for the item. Read-only. [Simplified from 3 options]"
).nullish(),
latitude: z.number().describe(
"Optional. The latitude, in decimal, for the item. Read-only. [Simplified from 3 options]"
).nullish(),
longitude: z.number().describe(
"Optional. The longitude, in decimal, for the item. Read-only. [Simplified from 3 options]"
).nullish()
}).passthrough();
const microsoft_graph_sharepointIds = z.object({
listId: z.string().describe("The unique identifier (guid) for the item's list in SharePoint.").nullish(),
listItemId: z.string().describe("An integer identifier for the item within the containing list.").nullish(),
listItemUniqueId: z.string().describe(
"The unique identifier (guid) for the item within OneDrive for Business or a SharePoint site."
).nullish(),
siteId: z.string().describe("The unique identifier (guid) for the item's site collection (SPSite).").nullish(),
siteUrl: z.string().describe("The SharePoint URL for the site that contains the item.").nullish(),
tenantId: z.string().describe("The unique identifier (guid) for the tenancy.").nullish(),
webId: z.string().describe("The unique identifier (guid) for the item's site (SPWeb).").nullish()
}).passthrough();
const microsoft_graph_itemReference = z.object({
driveId: z.string().describe(
"Unique identifier of the drive instance that contains the driveItem. Only returned if the item is located in a drive. Read-only."
).nullish(),
driveType: z.string().describe(
"Identifies the type of drive. Only returned if the item is located in a drive. See drive resource for values."
).nullish(),
id: z.string().describe(
"Unique identifier of the driveItem in the drive or a listItem in a list. Read-only."
).nullish(),
name: z.string().describe("The name of the item being referenced. Read-only.").nullish(),
path: z.string().describe("Percent-encoded path that can be used to navigate to the item. Read-only.").nullish(),
shareId: z.string().describe(
"A unique identifier for a shared resource that can be accessed via the Shares API."
).nullish(),
sharepointIds: microsoft_graph_sharepointIds.optional(),
siteId: z.string().describe(
"For OneDrive for Business and SharePoint, this property represents the ID of the site that contains the parent document library of the driveItem resource or the parent list of the listItem resource. The value is the same as the id property of that site resource. It is an opaque string that consists of three identifiers of the site. For OneDrive, this property is not populated."
).nullish()
}).passthrough();
const microsoft_graph_assignedLicense = z.object({
disabledPlans: z.array(
z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/).uuid()
).describe(
"A collection of the unique identifiers for plans that have been disabled. IDs are available in servicePlans > servicePlanId in the tenant's subscribedSkus or serviceStatus > servicePlanId in the tenant's companySubscription."
).optional(),
skuId: z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/).uuid().describe(
"The unique identifier for the SKU. Corresponds to the skuId from subscribedSkus or companySubscription."
).nullish()
}).passthrough();
const microsoft_graph_assignedPlan = z.object({
assignedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The date and time at which the plan was assigned. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z."
).nullish(),
capabilityStatus: z.string().describe(
"Condition of the capability assignment. The possible values are Enabled, Warning, Suspended, Deleted, LockedOut. See a detailed description of each value."
).nullish(),
service: z.string().describe("The name of the service; for example, exchange.").nullish(),
servicePlanId: z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/).uuid().describe(
"A GUID that identifies the service plan. For a complete list of GUIDs and their equivalent friendly service names, see Product names and service plan identifiers for licensing."
).nullish()
}).passthrough();
const microsoft_graph_authorizationInfo = z.object({ certificateUserIds: z.array(z.string().nullable()).optional() }).passthrough();
const microsoft_graph_customSecurityAttributeValue = z.object({}).passthrough();
const microsoft_graph_user = z.object({
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
displayName: z.string().describe(
"The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and family name. This property is required when a user is created and it can't be cleared during updates. Maximum length is 256 characters. Returned by default. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values), $orderby, and $search."
).nullish(),
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The date and time the user was created, in ISO 8601 format and UTC. The value can't be modified and is automatically populated when the entity is created. Nullable. For on-premises users, the value represents when they were first created in Microsoft Entra ID. Property is null for some users created before June 2018 and on-premises users that were synced to Microsoft Entra ID before June 2018. Read-only. Requires $select to retrieve. Supports $filter (eq, ne, not , ge, le, in)."
).nullish(),
state: z.string().describe(
"The state or province in the user's address. Maximum length is 128 characters. Requires $select to retrieve. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
).nullish(),
userPrincipalName: z.string().describe(
"The user principal name (UPN) of the user. The UPN is an Internet-style sign-in name for the user based on the Internet standard RFC 822. By convention, this value should map to the user's email name. The general format is alias@domain, where the domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization.NOTE: This property can't contain accent characters. Only the following characters are allowed A - Z, a - z, 0 - 9, ' . - _ ! # ^ ~. For the complete list of allowed characters, see username policies. Returned by default. Supports $filter (eq, ne, not, ge, le, in, startsWith, endsWith) and $orderby."
).nullish(),
deletedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"Date and time when this object was deleted. Always null when the object hasn't been deleted."
).nullish(),
aboutMe: z.string().describe(
"A freeform text entry field for the user to describe themselves. Requires $select to retrieve."
).nullish(),
accountEnabled: z.boolean().describe(
"true if the account is enabled; otherwise, false. This property is required when a user is created. Requires $select to retrieve. Supports $filter (eq, ne, not, and in)."
).nullish(),
ageGroup: z.string().describe(
"Sets the age group of the user. Allowed values: null, Minor, NotAdult, and Adult. For more information, see legal age group property definitions. Requires $select to retrieve. Supports $filter (eq, ne, not, and in)."
).nullish(),
assignedLicenses: z.array(microsoft_graph_assignedLicense).describe(
"The licenses that are assigned to the user, including inherited (group-based) licenses. This property doesn't differentiate between directly assigned and inherited licenses. Use the licenseAssignmentStates property to identify the directly assigned and inherited licenses. Not nullable. Requires $select to retrieve. Supports $filter (eq, not, /$count eq 0, /$count ne 0)."
).optional(),
assignedPlans: z.array(microsoft_graph_assignedPlan).describe(
"The plans that are assigned to the user. Read-only. Not nullable. Requires $select to retrieve. Supports $filter (eq and not)."
).optional(),
authorizationInfo: microsoft_graph_authorizationInfo.optional(),
birthday: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The birthday of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014, is 2014-01-01T00:00:00Z. Requires $select to retrieve."
).optional(),
businessPhones: z.array(z.string()).describe(
"The telephone numbers for the user. NOTE: Although it's a string collection, only one number can be set for this property. Read-only for users synced from the on-premises directory. Returned by default. Supports $filter (eq, not, ge, le, startsWith)."
).optional(),
city: z.string().describe(
"The city where the user is located. Maximum length is 128 characters. Requires $select to retrieve. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
).nullish(),
companyName: z.string().describe(
"The name of the company that the user is associated with. This property can be useful for describing the company that a guest comes from. The maximum length is 64 characters.Requires $select to retrieve. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
).nullish(),
consentProvidedForMinor: z.string().describe(
"Sets whether consent was obtained for minors. Allowed values: null, Granted, Denied, and NotRequired. For more information, see legal age group property definitions. Requires $select to retrieve. Supports $filter (eq, ne, not, and in)."
).nullish(),
country: z.string().describe(
"The country or region where the user is located; for example, US or UK. Maximum length is 128 characters. Requires $select to retrieve. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
).nullish(),
creationType: z.string().describe(
"Indicates whether the user account was created through one of the following methods: As a regular school or work account (null). As an external account (Invitation). As a local account for an Azure Active Directory B2C tenant (LocalAccount). Through self-service sign-up by an internal user using email verification (EmailVerified). Through self-service sign-up by a guest signing up through a link that is part of a user flow (SelfServiceSignUp). Read-only.Requires $select to retrieve. Supports $filter (eq, ne, not, in)."
).nullish(),
customSecurityAttributes: microsoft_graph_customSecurityAttributeValue.optional(),
department: z.string().describe(
"The name of the department in which the user works. Maximum length is 64 characters. Requires $select to retrieve. Supports $filter (eq, ne, not , ge, le, in, and eq on null values)."
).nullish(),
deviceEnrollmentLimit: z.number().gte(-2147483648).lte(2147483647).describe(
"The limit on the maximum number of devices that the user is permitted to enroll. Allowed values are 5 or 1000."
).optional(),
employeeHireDate: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The date and time when the user was hired or will start work in a future hire. Requires $select to retrieve. Supports $filter (eq, ne, not , ge, le, in)."
).nullish(),
employeeId: z.string().describe(
"The employee identifier assigned to the user by the organization. The maximum length is 16 characters. Requires $select to retrieve. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values)."
).nullish(),
employeeLeaveDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The date and time when the user left or will leave the organization. To read this property, the calling app must be assigned the User-LifeCycleInfo.Read.All permission. To write this property, the calling app must be assigned the User.Read.All and User-LifeCycleInfo.ReadWrite.All permissions. To read this property in delegated scenarios, the admin needs at least one of the following Microsoft Entra roles: Lifecycle Workflows Administrator (least privilege), Global Reader. To write this property in delegated scenarios, the admin needs the Global Administrator role. Supports $filter (eq, ne, not , ge, le, in). For more information, see Configure the employeeLeaveDateTime property for a user."
).nullish()
}).passthrough().passthrough();
const microsoft_graph_audio = z.object({
album: z.string().describe("The title of the album for this audio file.").nullish(),
albumArtist: z.string().describe("The artist named on the album for the audio file.").nullish(),
artist: z.string().describe("The performing artist for the audio file.").nullish(),
bitrate: z.number().describe("Bitrate expressed in kbps.").nullish(),
composers: z.string().describe("The name of the composer of the audio file.").nullish(),
copyright: z.string().describe("Copyright information for the audio file.").nullish(),
disc: z.number().gte(-32768).lte(32767).describe("The number of the disc this audio file came from.").nullish(),
discCount: z.number().gte(-32768).lte(32767).describe("The total number of discs in this album.").nullish(),
duration: z.number().describe("Duration of the audio file, expressed in milliseconds").nullish(),
genre: z.string().describe("The genre of this audio file.").nullish(),
hasDrm: z.boolean().describe("Indicates if the file is protected with digital rights management.").nullish(),
isVariableBitrate: z.boolean().describe("Indicates if the file is encoded with a variable bitrate.").nullish(),
title: z.string().describe("The title of the audio file.").nullish(),
track: z.number().gte(-2147483648).lte(2147483647).describe("The number of the track on the original disc for this audio file.").nullish(),
trackCount: z.number().gte(-2147483648).lte(2147483647).describe("The total number of tracks on the original disc for this audio file.").nullish(),
year: z.number().gte(-2147483648).lte(2147483647).describe("The year the audio file was recorded.").nullish()
}).passthrough();
const microsoft_graph_album = z.object({
coverImageItemId: z.string().describe("Unique identifier of the driveItem that is the cover of the album.").nullish()
}).passthrough();
const microsoft_graph_bundle = z.object({
album: microsoft_graph_album.optional(),
childCount: z.number().gte(-2147483648).lte(2147483647).describe("Number of children contained immediately within this container.").nullish()
}).passthrough();
const microsoft_graph_deleted = z.object({ state: z.string().describe("Represents the state of the deleted item.").nullish() }).passthrough();
const microsoft_graph_hashes = z.object({
crc32Hash: z.string().describe("The CRC32 value of the file (if available). Read-only.").nullish(),
quickXorHash: z.string().describe(
"A proprietary hash of the file that can be used to determine if the contents of the file change (if available). Read-only."
).nullish(),
sha1Hash: z.string().describe("SHA1 hash for the contents of the file (if available). Read-only.").nullish(),
sha256Hash: z.string().describe("This property isn't supported. Don't use.").nullish()
}).passthrough();
const microsoft_graph_file = z.object({
hashes: microsoft_graph_hashes.optional(),
mimeType: z.string().describe(
"The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only."
).nullish(),
processingMetadata: z.boolean().nullish()
}).passthrough();
const microsoft_graph_fileSystemInfo = z.object({
createdDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("The UTC date and time the file was created on a client.").nullish(),
lastAccessedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe(
"The UTC date and time the file was last accessed. Available for the recent file list only."
).nullish(),
lastModifiedDateTime: z.string().regex(
/^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$/
).datetime({ offset: true }).describe("The UTC date and time the file was last modified on a client.").nullish()
}).passthrough();
const microsoft_graph_folderView = z.object({
sortBy: z.string().describe("The method by which the folder should be sorted.").nullish(),
sortOrder: z.string().describe(
"If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending."
).nullish(),
viewType: z.string().describe("The type of view that should be used to represent the folder.").nullish()
}).passthrough();
const microsoft_graph_folder = z.object({
childCount: z.number().gte(-2147483648).lte(2147483647).describe("Number of children contained immediately within this container.").nullish(),
view: microsoft_graph_folderView.optional()
}).passthrough();
const