@softeria/ms-365-mcp-server 0.85.0 → 0.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -567,10 +567,10 @@ const microsoft_graph_user = z.object({
567
567
  createdDateTime: z.string().regex(
568
568
  /^[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])$/
569
569
  ).datetime({ offset: true }).describe(
570
- "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. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in)."
570
+ "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)."
571
571
  ).nullish(),
572
572
  state: z.string().describe(
573
- "The state or province in the user's address. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
573
+ "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)."
574
574
  ).nullish(),
575
575
  userPrincipalName: z.string().describe(
576
576
  "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."
@@ -581,47 +581,47 @@ const microsoft_graph_user = z.object({
581
581
  "Date and time when this object was deleted. Always null when the object hasn't been deleted."
582
582
  ).nullish(),
583
583
  aboutMe: z.string().describe(
584
- "A freeform text entry field for the user to describe themselves. Returned only on $select."
584
+ "A freeform text entry field for the user to describe themselves. Requires $select to retrieve."
585
585
  ).nullish(),
586
586
  accountEnabled: z.boolean().describe(
587
- "true if the account is enabled; otherwise, false. This property is required when a user is created. Returned only on $select. Supports $filter (eq, ne, not, and in)."
587
+ "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)."
588
588
  ).nullish(),
589
589
  ageGroup: z.string().describe(
590
- "Sets the age group of the user. Allowed values: null, Minor, NotAdult, and Adult. For more information, see legal age group property definitions. Returned only on $select. Supports $filter (eq, ne, not, and in)."
590
+ "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)."
591
591
  ).nullish(),
592
592
  assignedLicenses: z.array(microsoft_graph_assignedLicense).describe(
593
- "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. Returned only on $select. Supports $filter (eq, not, /$count eq 0, /$count ne 0)."
593
+ "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)."
594
594
  ).optional(),
595
595
  assignedPlans: z.array(microsoft_graph_assignedPlan).describe(
596
- "The plans that are assigned to the user. Read-only. Not nullable. Returned only on $select. Supports $filter (eq and not)."
596
+ "The plans that are assigned to the user. Read-only. Not nullable. Requires $select to retrieve. Supports $filter (eq and not)."
597
597
  ).optional(),
598
598
  authorizationInfo: microsoft_graph_authorizationInfo.optional(),
599
599
  birthday: z.string().regex(
600
600
  /^[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])$/
601
601
  ).datetime({ offset: true }).describe(
602
- "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. Returned only on $select."
602
+ "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."
603
603
  ).optional(),
604
604
  businessPhones: z.array(z.string()).describe(
605
605
  "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)."
606
606
  ).optional(),
607
607
  city: z.string().describe(
608
- "The city where the user is located. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
608
+ "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)."
609
609
  ).nullish(),
610
610
  companyName: z.string().describe(
611
- "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.Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
611
+ "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)."
612
612
  ).nullish(),
613
613
  consentProvidedForMinor: z.string().describe(
614
- "Sets whether consent was obtained for minors. Allowed values: null, Granted, Denied, and NotRequired. For more information, see legal age group property definitions. Returned only on $select. Supports $filter (eq, ne, not, and in)."
614
+ "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)."
615
615
  ).nullish(),
616
616
  country: z.string().describe(
617
- "The country or region where the user is located; for example, US or UK. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values)."
617
+ "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)."
618
618
  ).nullish(),
619
619
  creationType: z.string().describe(
620
- "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.Returned only on $select. Supports $filter (eq, ne, not, in)."
620
+ "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)."
621
621
  ).nullish(),
622
622
  customSecurityAttributes: microsoft_graph_customSecurityAttributeValue.optional(),
623
623
  department: z.string().describe(
624
- "The name of the department in which the user works. Maximum length is 64 characters. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, and eq on null values)."
624
+ "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)."
625
625
  ).nullish(),
626
626
  deviceEnrollmentLimit: z.number().gte(-2147483648).lte(2147483647).describe(
627
627
  "The limit on the maximum number of devices that the user is permitted to enroll. Allowed values are 5 or 1000."
@@ -629,10 +629,10 @@ const microsoft_graph_user = z.object({
629
629
  employeeHireDate: z.string().regex(
630
630
  /^[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])$/
631
631
  ).datetime({ offset: true }).describe(
632
- "The date and time when the user was hired or will start work in a future hire. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in)."
632
+ "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)."
633
633
  ).nullish(),
634
634
  employeeId: z.string().describe(
635
- "The employee identifier assigned to the user by the organization. The maximum length is 16 characters. Returned only on $select. Supports $filter (eq, ne, not , ge, le, in, startsWith, and eq on null values)."
635
+ "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)."
636
636
  ).nullish(),
637
637
  employeeLeaveDateTime: z.string().regex(
638
638
  /^[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])$/
@@ -1382,16 +1382,16 @@ const microsoft_graph_group = z.object({
1382
1382
  "Date and time when this object was deleted. Always null when the object hasn't been deleted."
1383
1383
  ).nullish(),
1384
1384
  allowExternalSenders: z.boolean().describe(
1385
- "Indicates if people external to the organization can send messages to the group. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
1385
+ "Indicates if people external to the organization can send messages to the group. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
1386
1386
  ).nullish(),
1387
1387
  assignedLabels: z.array(microsoft_graph_assignedLabel).describe(
1388
- "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Returned only on $select. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
1388
+ "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Requires $select to retrieve. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
1389
1389
  ).optional(),
1390
1390
  assignedLicenses: z.array(microsoft_graph_assignedLicense).describe(
1391
- "The licenses that are assigned to the group. Returned only on $select. Supports $filter (eq). Read-only."
1391
+ "The licenses that are assigned to the group. Requires $select to retrieve. Supports $filter (eq). Read-only."
1392
1392
  ).optional(),
1393
1393
  autoSubscribeNewMembers: z.boolean().describe(
1394
- "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
1394
+ "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
1395
1395
  ).nullish(),
1396
1396
  classification: z.string().describe(
1397
1397
  "Describes a classification for the group (such as low, medium, or high business impact). Valid values for this property are defined by creating a ClassificationList setting value, based on the template definition.Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith)."
@@ -1408,10 +1408,10 @@ const microsoft_graph_group = z.object({
1408
1408
  "Indicates whether there are members in this group that have license errors from its group-based license assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get groups that have members with license errors (that is, filter for this property being true). See an example. Supports $filter (eq)."
1409
1409
  ).nullish(),
1410
1410
  hideFromAddressLists: z.boolean().describe(
1411
- "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
1411
+ "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
1412
1412
  ).nullish(),
1413
1413
  hideFromOutlookClients: z.boolean().describe(
1414
- "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
1414
+ "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
1415
1415
  ).nullish(),
1416
1416
  isArchived: z.boolean().describe(
1417
1417
  "When a group is associated with a team, this property determines whether the team is in read-only mode.To read this property, use the /group/{groupId}/team endpoint or the Get team API. To update this property, use the archiveTeam and unarchiveTeam APIs."
@@ -1420,10 +1420,10 @@ const microsoft_graph_group = z.object({
1420
1420
  "Indicates whether this group can be assigned to a Microsoft Entra role. Optional. This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true, visibility must be Hidden, and the group can't be a dynamic group (that is, groupTypes can't contain DynamicMembership). Only callers with at least the Privileged Role Administrator role can set this property. The caller must also be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Microsoft Entra role assignmentsUsing this feature requires a Microsoft Entra ID P1 license. Returned by default. Supports $filter (eq, ne, not)."
1421
1421
  ).nullish(),
1422
1422
  isManagementRestricted: z.boolean().describe(
1423
- "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Returned only on $select."
1423
+ "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Requires $select to retrieve."
1424
1424
  ).nullish(),
1425
1425
  isSubscribedByMail: z.boolean().describe(
1426
- "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
1426
+ "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
1427
1427
  ).nullish(),
1428
1428
  licenseProcessingState: microsoft_graph_licenseProcessingState.optional(),
1429
1429
  mail: z.string().describe(
@@ -1519,7 +1519,7 @@ const microsoft_graph_post = z.lazy(
1519
1519
  );
1520
1520
  const microsoft_graph_conversationThread = z.object({
1521
1521
  id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
1522
- ccRecipients: z.array(microsoft_graph_recipient).describe("The Cc: recipients for the thread. Returned only on $select.").optional(),
1522
+ ccRecipients: z.array(microsoft_graph_recipient).describe("The Cc: recipients for the thread. Requires $select to retrieve.").optional(),
1523
1523
  hasAttachments: z.boolean().describe(
1524
1524
  "Indicates whether any of the posts within this thread has at least one attachment. Returned by default."
1525
1525
  ).optional(),
@@ -1535,7 +1535,7 @@ const microsoft_graph_conversationThread = z.object({
1535
1535
  topic: z.string().describe(
1536
1536
  "The topic of the conversation. This property can be set when the conversation is created, but it cannot be updated. Returned by default."
1537
1537
  ).optional(),
1538
- toRecipients: z.array(microsoft_graph_recipient).describe("The To: recipients for the thread. Returned only on $select.").optional(),
1538
+ toRecipients: z.array(microsoft_graph_recipient).describe("The To: recipients for the thread. Requires $select to retrieve.").optional(),
1539
1539
  uniqueSenders: z.array(z.string()).describe("All the users that sent a message to this thread. Returned by default.").optional(),
1540
1540
  posts: z.array(microsoft_graph_post).optional()
1541
1541
  }).passthrough();
@@ -2550,6 +2550,7 @@ const microsoft_graph_teamVisibilityType = z.enum([
2550
2550
  "hiddenMembership",
2551
2551
  "unknownFutureValue"
2552
2552
  ]);
2553
+ const microsoft_graph_channelLayoutType = z.enum(["post", "chat", "unknownFutureValue"]);
2553
2554
  const microsoft_graph_channelMembershipType = z.enum([
2554
2555
  "standard",
2555
2556
  "private",
@@ -2587,6 +2588,7 @@ const microsoft_graph_channel = z.lazy(
2587
2588
  isFavoriteByDefault: z.boolean().describe(
2588
2589
  "Indicates whether the channel should be marked as recommended for all members of the team to show in their channel list. Note: All recommended channels automatically show in the channels list for education and frontline worker users. The property can only be set programmatically via the Create team method. The default value is false."
2589
2590
  ).nullish(),
2591
+ layoutType: microsoft_graph_channelLayoutType.optional(),
2590
2592
  membershipType: microsoft_graph_channelMembershipType.optional(),
2591
2593
  migrationMode: microsoft_graph_migrationMode.optional(),
2592
2594
  originalCreatedDateTime: z.string().regex(
@@ -2911,7 +2913,7 @@ const microsoft_graph_message = z.object({
2911
2913
  ).nullish(),
2912
2914
  inferenceClassification: microsoft_graph_inferenceClassificationType.optional(),
2913
2915
  internetMessageHeaders: z.array(microsoft_graph_internetMessageHeader).describe(
2914
- "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Returned only on applying a $select query option. Read-only."
2916
+ "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Requires $select to retrieve. Read-only."
2915
2917
  ).optional(),
2916
2918
  internetMessageId: z.string().describe("The message ID in the format specified by RFC2822.").nullish(),
2917
2919
  isDeliveryReceiptRequested: z.boolean().describe("Indicates whether a read receipt is requested for the message.").nullish(),
@@ -4567,6 +4569,7 @@ const schemas = {
4567
4569
  microsoft_graph_teamSpecialization,
4568
4570
  microsoft_graph_teamSummary,
4569
4571
  microsoft_graph_teamVisibilityType,
4572
+ microsoft_graph_channelLayoutType,
4570
4573
  microsoft_graph_channelMembershipType,
4571
4574
  microsoft_graph_channelSummary,
4572
4575
  microsoft_graph_sharedWithChannelTeamInfo,
@@ -5988,16 +5991,16 @@ You can search within a folder hierarchy, a whole drive, or files shared with th
5988
5991
  "Date and time when this object was deleted. Always null when the object hasn't been deleted."
5989
5992
  ).nullish(),
5990
5993
  allowExternalSenders: z.boolean().describe(
5991
- "Indicates if people external to the organization can send messages to the group. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
5994
+ "Indicates if people external to the organization can send messages to the group. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
5992
5995
  ).nullish(),
5993
5996
  assignedLabels: z.array(microsoft_graph_assignedLabel).describe(
5994
- "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Returned only on $select. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
5997
+ "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Requires $select to retrieve. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
5995
5998
  ).optional(),
5996
5999
  assignedLicenses: z.array(microsoft_graph_assignedLicense).describe(
5997
- "The licenses that are assigned to the group. Returned only on $select. Supports $filter (eq). Read-only."
6000
+ "The licenses that are assigned to the group. Requires $select to retrieve. Supports $filter (eq). Read-only."
5998
6001
  ).optional(),
5999
6002
  autoSubscribeNewMembers: z.boolean().describe(
6000
- "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6003
+ "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6001
6004
  ).nullish(),
6002
6005
  classification: z.string().describe(
6003
6006
  "Describes a classification for the group (such as low, medium, or high business impact). Valid values for this property are defined by creating a ClassificationList setting value, based on the template definition.Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith)."
@@ -6014,10 +6017,10 @@ You can search within a folder hierarchy, a whole drive, or files shared with th
6014
6017
  "Indicates whether there are members in this group that have license errors from its group-based license assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get groups that have members with license errors (that is, filter for this property being true). See an example. Supports $filter (eq)."
6015
6018
  ).nullish(),
6016
6019
  hideFromAddressLists: z.boolean().describe(
6017
- "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6020
+ "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6018
6021
  ).nullish(),
6019
6022
  hideFromOutlookClients: z.boolean().describe(
6020
- "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6023
+ "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6021
6024
  ).nullish(),
6022
6025
  isArchived: z.boolean().describe(
6023
6026
  "When a group is associated with a team, this property determines whether the team is in read-only mode.To read this property, use the /group/{groupId}/team endpoint or the Get team API. To update this property, use the archiveTeam and unarchiveTeam APIs."
@@ -6026,10 +6029,10 @@ You can search within a folder hierarchy, a whole drive, or files shared with th
6026
6029
  "Indicates whether this group can be assigned to a Microsoft Entra role. Optional. This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true, visibility must be Hidden, and the group can't be a dynamic group (that is, groupTypes can't contain DynamicMembership). Only callers with at least the Privileged Role Administrator role can set this property. The caller must also be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Microsoft Entra role assignmentsUsing this feature requires a Microsoft Entra ID P1 license. Returned by default. Supports $filter (eq, ne, not)."
6027
6030
  ).nullish(),
6028
6031
  isManagementRestricted: z.boolean().describe(
6029
- "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Returned only on $select."
6032
+ "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Requires $select to retrieve."
6030
6033
  ).nullish(),
6031
6034
  isSubscribedByMail: z.boolean().describe(
6032
- "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6035
+ "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6033
6036
  ).nullish(),
6034
6037
  licenseProcessingState: microsoft_graph_licenseProcessingState.optional(),
6035
6038
  mail: z.string().describe(
@@ -6103,16 +6106,16 @@ You can create or update the following types of group: By default, this operatio
6103
6106
  "Date and time when this object was deleted. Always null when the object hasn't been deleted."
6104
6107
  ).nullish(),
6105
6108
  allowExternalSenders: z.boolean().describe(
6106
- "Indicates if people external to the organization can send messages to the group. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6109
+ "Indicates if people external to the organization can send messages to the group. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6107
6110
  ).nullish(),
6108
6111
  assignedLabels: z.array(microsoft_graph_assignedLabel).describe(
6109
- "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Returned only on $select. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
6112
+ "The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group. Requires $select to retrieve. This property can be updated only in delegated scenarios where the caller requires both the Microsoft Graph permission and a supported administrator role."
6110
6113
  ).optional(),
6111
6114
  assignedLicenses: z.array(microsoft_graph_assignedLicense).describe(
6112
- "The licenses that are assigned to the group. Returned only on $select. Supports $filter (eq). Read-only."
6115
+ "The licenses that are assigned to the group. Requires $select to retrieve. Supports $filter (eq). Read-only."
6113
6116
  ).optional(),
6114
6117
  autoSubscribeNewMembers: z.boolean().describe(
6115
- "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6118
+ "Indicates if new members added to the group are autosubscribed to receive email notifications. You can set this property in a PATCH request for the group; don't set it in the initial POST request that creates the group. Default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6116
6119
  ).nullish(),
6117
6120
  classification: z.string().describe(
6118
6121
  "Describes a classification for the group (such as low, medium, or high business impact). Valid values for this property are defined by creating a ClassificationList setting value, based on the template definition.Returned by default. Supports $filter (eq, ne, not, ge, le, startsWith)."
@@ -6129,10 +6132,10 @@ You can create or update the following types of group: By default, this operatio
6129
6132
  "Indicates whether there are members in this group that have license errors from its group-based license assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get groups that have members with license errors (that is, filter for this property being true). See an example. Supports $filter (eq)."
6130
6133
  ).nullish(),
6131
6134
  hideFromAddressLists: z.boolean().describe(
6132
- "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6135
+ "True if the group isn't displayed in certain parts of the Outlook UI: the Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6133
6136
  ).nullish(),
6134
6137
  hideFromOutlookClients: z.boolean().describe(
6135
- "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6138
+ "True if the group isn't displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, false. The default value is false. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6136
6139
  ).nullish(),
6137
6140
  isArchived: z.boolean().describe(
6138
6141
  "When a group is associated with a team, this property determines whether the team is in read-only mode.To read this property, use the /group/{groupId}/team endpoint or the Get team API. To update this property, use the archiveTeam and unarchiveTeam APIs."
@@ -6141,10 +6144,10 @@ You can create or update the following types of group: By default, this operatio
6141
6144
  "Indicates whether this group can be assigned to a Microsoft Entra role. Optional. This property can only be set while creating the group and is immutable. If set to true, the securityEnabled property must also be set to true, visibility must be Hidden, and the group can't be a dynamic group (that is, groupTypes can't contain DynamicMembership). Only callers with at least the Privileged Role Administrator role can set this property. The caller must also be assigned the RoleManagement.ReadWrite.Directory permission to set this property or update the membership of such groups. For more, see Using a group to manage Microsoft Entra role assignmentsUsing this feature requires a Microsoft Entra ID P1 license. Returned by default. Supports $filter (eq, ne, not)."
6142
6145
  ).nullish(),
6143
6146
  isManagementRestricted: z.boolean().describe(
6144
- "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Returned only on $select."
6147
+ "Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. Requires $select to retrieve."
6145
6148
  ).nullish(),
6146
6149
  isSubscribedByMail: z.boolean().describe(
6147
- "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Returned only on $select. Supported only on the Get group API (GET /groups/{ID})."
6150
+ "Indicates whether the signed-in user is subscribed to receive email conversations. The default value is true. Requires $select to retrieve. Supported only on the Get group API (GET /groups/{ID})."
6148
6151
  ).nullish(),
6149
6152
  licenseProcessingState: microsoft_graph_licenseProcessingState.optional(),
6150
6153
  mail: z.string().describe(
@@ -8519,7 +8522,7 @@ folder collection and navigate to another folder. By default, this operation doe
8519
8522
  ).nullish(),
8520
8523
  inferenceClassification: microsoft_graph_inferenceClassificationType.optional(),
8521
8524
  internetMessageHeaders: z.array(microsoft_graph_internetMessageHeader).describe(
8522
- "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Returned only on applying a $select query option. Read-only."
8525
+ "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Requires $select to retrieve. Read-only."
8523
8526
  ).optional(),
8524
8527
  internetMessageId: z.string().describe("The message ID in the format specified by RFC2822.").nullish(),
8525
8528
  isDeliveryReceiptRequested: z.boolean().describe("Indicates whether a read receipt is requested for the message.").nullish(),
@@ -8601,7 +8604,7 @@ folder collection and navigate to another folder. By default, this operation doe
8601
8604
  ).nullish(),
8602
8605
  inferenceClassification: microsoft_graph_inferenceClassificationType.optional(),
8603
8606
  internetMessageHeaders: z.array(microsoft_graph_internetMessageHeader).describe(
8604
- "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Returned only on applying a $select query option. Read-only."
8607
+ "A collection of message headers defined by RFC5322. The set includes message headers indicating the network path taken by a message from the sender to the recipient. It can also contain custom message headers that hold app data for the message. Requires $select to retrieve. Read-only."
8605
8608
  ).optional(),
8606
8609
  internetMessageId: z.string().describe("The message ID in the format specified by RFC2822.").nullish(),
8607
8610
  isDeliveryReceiptRequested: z.boolean().describe("Indicates whether a read receipt is requested for the message.").nullish(),
@@ -54,11 +54,17 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
54
54
  if (codeVerifier) {
55
55
  params.append("code_verifier", codeVerifier);
56
56
  }
57
+ const headers = {
58
+ "Content-Type": "application/x-www-form-urlencoded"
59
+ };
60
+ try {
61
+ const redirectUrl = new URL(redirectUri);
62
+ headers["Origin"] = redirectUrl.origin;
63
+ } catch {
64
+ }
57
65
  const response = await fetch(`${cloudEndpoints.authority}/${tenantId}/oauth2/v2.0/token`, {
58
66
  method: "POST",
59
- headers: {
60
- "Content-Type": "application/x-www-form-urlencoded"
61
- },
67
+ headers,
62
68
  body: params
63
69
  });
64
70
  if (!response.ok) {
@@ -68,7 +74,7 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
68
74
  }
69
75
  return response.json();
70
76
  }
71
- async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId = "common", cloudType = "global") {
77
+ async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId = "common", cloudType = "global", origin) {
72
78
  const cloudEndpoints = getCloudEndpoints(cloudType);
73
79
  const params = new URLSearchParams({
74
80
  grant_type: "refresh_token",
@@ -78,11 +84,15 @@ async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId
78
84
  if (clientSecret) {
79
85
  params.append("client_secret", clientSecret);
80
86
  }
87
+ const headers = {
88
+ "Content-Type": "application/x-www-form-urlencoded"
89
+ };
90
+ if (origin) {
91
+ headers["Origin"] = origin;
92
+ }
81
93
  const response = await fetch(`${cloudEndpoints.authority}/${tenantId}/oauth2/v2.0/token`, {
82
94
  method: "POST",
83
- headers: {
84
- "Content-Type": "application/x-www-form-urlencoded"
85
- },
95
+ headers,
86
96
  body: params
87
97
  });
88
98
  if (!response.ok) {
package/dist/server.js CHANGED
@@ -266,7 +266,17 @@ class MicrosoftGraphServer {
266
266
  }
267
267
  microsoftAuthUrl.searchParams.set("client_id", clientId);
268
268
  if (!microsoftAuthUrl.searchParams.get("scope")) {
269
- microsoftAuthUrl.searchParams.set("scope", "User.Read Files.Read Mail.Read");
269
+ microsoftAuthUrl.searchParams.set(
270
+ "scope",
271
+ "User.Read Files.Read Mail.Read offline_access"
272
+ );
273
+ } else {
274
+ const scopeValue = microsoftAuthUrl.searchParams.get("scope");
275
+ const scopeList = scopeValue.split(/\s+/).filter(Boolean);
276
+ if (!scopeList.includes("offline_access")) {
277
+ scopeList.push("offline_access");
278
+ microsoftAuthUrl.searchParams.set("scope", scopeList.join(" "));
279
+ }
270
280
  }
271
281
  res.redirect(microsoftAuthUrl.toString());
272
282
  });
@@ -341,12 +351,14 @@ class MicrosoftGraphServer {
341
351
  } else {
342
352
  logger.info("Refresh endpoint: Using public client without client_secret");
343
353
  }
354
+ const origin = req.get("origin") || req.get("referer") || void 0;
344
355
  const result = await refreshAccessToken(
345
356
  body.refresh_token,
346
357
  clientId,
347
358
  clientSecret,
348
359
  tenantId,
349
- this.secrets.cloudType
360
+ this.secrets.cloudType,
361
+ origin
350
362
  );
351
363
  res.json(result);
352
364
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.85.0",
3
+ "version": "0.85.1",
4
4
  "description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",