@softeria/ms-365-mcp-server 0.15.0 → 0.17.0

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.
@@ -389,6 +389,13 @@ function findUsedSchemas(openApiSpec) {
389
389
  const schemaName = content.schema.$ref.replace('#/components/schemas/', '');
390
390
  schemasToProcess.push(schemaName);
391
391
  }
392
+ if (content.schema?.properties?.requests?.items?.$ref) {
393
+ const schemaName = content.schema.properties.requests.items.$ref.replace(
394
+ '#/components/schemas/',
395
+ ''
396
+ );
397
+ schemasToProcess.push(schemaName);
398
+ }
392
399
  });
393
400
  }
394
401
 
@@ -413,6 +420,21 @@ function findUsedSchemas(openApiSpec) {
413
420
  const schemaName = content.schema.$ref.replace('#/components/schemas/', '');
414
421
  schemasToProcess.push(schemaName);
415
422
  }
423
+ if (content.schema?.allOf) {
424
+ content.schema.allOf.forEach((allOfItem) => {
425
+ if (allOfItem.$ref) {
426
+ const schemaName = allOfItem.$ref.replace('#/components/schemas/', '');
427
+ schemasToProcess.push(schemaName);
428
+ }
429
+ if (allOfItem.properties?.value?.items?.$ref) {
430
+ const schemaName = allOfItem.properties.value.items.$ref.replace(
431
+ '#/components/schemas/',
432
+ ''
433
+ );
434
+ schemasToProcess.push(schemaName);
435
+ }
436
+ });
437
+ }
416
438
  });
417
439
  }
418
440
  });
@@ -870,39 +870,17 @@ const microsoft_graph_workbookPivotTable = z.lazy(
870
870
  }).strict()
871
871
  );
872
872
  const microsoft_graph_workbookWorksheetProtectionOptions = z.object({
873
- allowAutoFilter: z.boolean().describe(
874
- "Indicates whether the worksheet protection option to allow the use of the autofilter feature is enabled."
875
- ).optional(),
876
- allowDeleteColumns: z.boolean().describe(
877
- "Indicates whether the worksheet protection option to allow deleting columns is enabled."
878
- ).optional(),
879
- allowDeleteRows: z.boolean().describe(
880
- "Indicates whether the worksheet protection option to allow deleting rows is enabled."
881
- ).optional(),
882
- allowFormatCells: z.boolean().describe(
883
- "Indicates whether the worksheet protection option to allow formatting cells is enabled."
884
- ).optional(),
885
- allowFormatColumns: z.boolean().describe(
886
- "Indicates whether the worksheet protection option to allow formatting columns is enabled."
887
- ).optional(),
888
- allowFormatRows: z.boolean().describe(
889
- "Indicates whether the worksheet protection option to allow formatting rows is enabled."
890
- ).optional(),
891
- allowInsertColumns: z.boolean().describe(
892
- "Indicates whether the worksheet protection option to allow inserting columns is enabled."
893
- ).optional(),
894
- allowInsertHyperlinks: z.boolean().describe(
895
- "Indicates whether the worksheet protection option to allow inserting hyperlinks is enabled."
896
- ).optional(),
897
- allowInsertRows: z.boolean().describe(
898
- "Indicates whether the worksheet protection option to allow inserting rows is enabled."
899
- ).optional(),
900
- allowPivotTables: z.boolean().describe(
901
- "Indicates whether the worksheet protection option to allow the use of the pivot table feature is enabled."
902
- ).optional(),
903
- allowSort: z.boolean().describe(
904
- "Indicates whether the worksheet protection option to allow the use of the sort feature is enabled."
905
- ).optional()
873
+ allowAutoFilter: z.boolean().describe("Represents the worksheet protection option of allowing using auto filter feature.").optional(),
874
+ allowDeleteColumns: z.boolean().describe("Represents the worksheet protection option of allowing deleting columns.").optional(),
875
+ allowDeleteRows: z.boolean().describe("Represents the worksheet protection option of allowing deleting rows.").optional(),
876
+ allowFormatCells: z.boolean().describe("Represents the worksheet protection option of allowing formatting cells.").optional(),
877
+ allowFormatColumns: z.boolean().describe("Represents the worksheet protection option of allowing formatting columns.").optional(),
878
+ allowFormatRows: z.boolean().describe("Represents the worksheet protection option of allowing formatting rows.").optional(),
879
+ allowInsertColumns: z.boolean().describe("Represents the worksheet protection option of allowing inserting columns.").optional(),
880
+ allowInsertHyperlinks: z.boolean().describe("Represents the worksheet protection option of allowing inserting hyperlinks.").optional(),
881
+ allowInsertRows: z.boolean().describe("Represents the worksheet protection option of allowing inserting rows.").optional(),
882
+ allowPivotTables: z.boolean().describe("Represents the worksheet protection option of allowing using pivot table feature.").optional(),
883
+ allowSort: z.boolean().describe("Represents the worksheet protection option of allowing using sort feature.").optional()
906
884
  }).strict();
907
885
  const microsoft_graph_workbookWorksheetProtection = z.object({
908
886
  id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
@@ -2827,7 +2805,203 @@ const microsoft_graph_plannerPlan = z.object({
2827
2805
  details: microsoft_graph_plannerPlanDetails.optional(),
2828
2806
  tasks: z.array(microsoft_graph_plannerTask).describe("Read-only. Nullable. Collection of tasks in the plan.").optional()
2829
2807
  }).strict();
2830
- const search_query_Body = z.object({ requests: z.array(z.object({}).partial().strict()) }).partial().strict();
2808
+ const microsoft_graph_bucketAggregationRange = z.object({
2809
+ from: z.string().describe(
2810
+ "Defines the lower bound from which to compute the aggregation. This can be a numeric value or a string representation of a date using the YYYY-MM-DDTHH:mm:ss.sssZ format. Required."
2811
+ ).optional(),
2812
+ to: z.string().describe(
2813
+ "Defines the upper bound up to which to compute the aggregation. This can be a numeric value or a string representation of a date using the YYYY-MM-DDTHH:mm:ss.sssZ format. Required."
2814
+ ).optional()
2815
+ }).strict();
2816
+ const microsoft_graph_bucketAggregationSortProperty = z.enum([
2817
+ "count",
2818
+ "keyAsString",
2819
+ "keyAsNumber",
2820
+ "unknownFutureValue"
2821
+ ]);
2822
+ const microsoft_graph_bucketAggregationDefinition = z.object({
2823
+ isDescending: z.boolean().describe(
2824
+ "True to specify the sort order as descending. The default is false, with the sort order as ascending. Optional."
2825
+ ).nullish(),
2826
+ minimumCount: z.number().gte(-2147483648).lte(2147483647).describe(
2827
+ "The minimum number of items that should be present in the aggregation to be returned in a bucket. Optional."
2828
+ ).nullish(),
2829
+ prefixFilter: z.string().describe(
2830
+ "A filter to define a matching criteria. The key should start with the specified prefix to be returned in the response. Optional."
2831
+ ).nullish(),
2832
+ ranges: z.array(microsoft_graph_bucketAggregationRange).describe(
2833
+ "Specifies the manual ranges to compute the aggregations. This is only valid for nonstring refiners of date or numeric type. Optional."
2834
+ ).optional(),
2835
+ sortBy: microsoft_graph_bucketAggregationSortProperty.optional()
2836
+ }).strict();
2837
+ const microsoft_graph_aggregationOption = z.object({
2838
+ bucketDefinition: microsoft_graph_bucketAggregationDefinition.optional(),
2839
+ field: z.string().describe(
2840
+ "Computes aggregation on the field while the field exists in the current entity type. Required."
2841
+ ).optional(),
2842
+ size: z.number().gte(-2147483648).lte(2147483647).describe(
2843
+ "The number of searchBucket resources to be returned. This isn't required when the range is provided manually in the search request. The minimum accepted size is 1, and the maximum is 65535. Optional."
2844
+ ).nullish()
2845
+ }).strict();
2846
+ const microsoft_graph_collapseProperty = z.object({
2847
+ fields: z.array(z.string()).describe(
2848
+ "Defines the collapse group to trim results. The properties in this collection must be sortable/refinable properties. Required."
2849
+ ).optional(),
2850
+ limit: z.number().gte(-32768).lte(32767).describe(
2851
+ "Defines a maximum limit count for this field. This numeric value must be a positive integer. Required."
2852
+ ).optional()
2853
+ }).strict();
2854
+ const microsoft_graph_entityType = z.enum([
2855
+ "event",
2856
+ "message",
2857
+ "driveItem",
2858
+ "externalItem",
2859
+ "site",
2860
+ "list",
2861
+ "listItem",
2862
+ "drive",
2863
+ "unknownFutureValue",
2864
+ "chatMessage",
2865
+ "person",
2866
+ "acronym",
2867
+ "bookmark"
2868
+ ]);
2869
+ const microsoft_graph_searchQuery = z.object({
2870
+ queryString: z.string().describe("The search query containing the search terms. Required.").optional(),
2871
+ queryTemplate: z.string().describe(
2872
+ "Provides a way to decorate the query string. Supports both KQL and query variables. Optional."
2873
+ ).nullish()
2874
+ }).strict();
2875
+ const microsoft_graph_searchAlterationOptions = z.object({
2876
+ enableModification: z.boolean().describe(
2877
+ "Indicates whether spelling modifications are enabled. If enabled, the user gets the search results for the corrected query if there were no results for the original query with typos. The response will also include the spelling modification information in the queryAlterationResponse property. Optional."
2878
+ ).nullish(),
2879
+ enableSuggestion: z.boolean().describe(
2880
+ "Indicates whether spelling suggestions are enabled. If enabled, the user gets the search results for the original search query and suggestions for spelling correction in the queryAlterationResponse property of the response for the typos in the query. Optional."
2881
+ ).nullish()
2882
+ }).strict();
2883
+ const microsoft_graph_resultTemplateOption = z.object({
2884
+ enableResultTemplate: z.boolean().describe(
2885
+ "Indicates whether search display layouts are enabled. If enabled, the user will get the result template to render the search results content in the resultTemplates property of the response. The result template is based on Adaptive Cards. Optional."
2886
+ ).nullish()
2887
+ }).strict();
2888
+ const microsoft_graph_searchContent = z.enum([
2889
+ "sharedContent",
2890
+ "privateContent",
2891
+ "unknownFutureValue"
2892
+ ]);
2893
+ const microsoft_graph_sharePointOneDriveOptions = z.object({ includeContent: microsoft_graph_searchContent.optional() }).strict();
2894
+ const microsoft_graph_sortProperty = z.object({
2895
+ isDescending: z.boolean().describe(
2896
+ "True if the sort order is descending. Default is false, with the sort order as ascending. Optional."
2897
+ ).nullish(),
2898
+ name: z.string().describe("The name of the property to sort on. Required.").optional()
2899
+ }).strict();
2900
+ const microsoft_graph_searchRequest = z.object({
2901
+ aggregationFilters: z.array(z.string().nullable()).describe(
2902
+ "Contains one or more filters to obtain search results aggregated and filtered to a specific value of a field. Optional.Build this filter based on a prior search that aggregates by the same field. From the response of the prior search, identify the searchBucket that filters results to the specific value of the field, use the string in its aggregationFilterToken property, and build an aggregation filter string in the format '{field}:/'{aggregationFilterToken}/''. If multiple values for the same field need to be provided, use the strings in its aggregationFilterToken property and build an aggregation filter string in the format '{field}:or(/'{aggregationFilterToken1}/',/'{aggregationFilterToken2}/')'. For example, searching and aggregating drive items by file type returns a searchBucket for the file type docx in the response. You can conveniently use the aggregationFilterToken returned for this searchBucket in a subsequent search query and filter matches down to drive items of the docx file type. Example 1 and example 2 show the actual requests and responses."
2903
+ ).optional(),
2904
+ aggregations: z.array(microsoft_graph_aggregationOption).describe(
2905
+ "Specifies aggregations (also known as refiners) to be returned alongside search results. Optional."
2906
+ ).optional(),
2907
+ collapseProperties: z.array(microsoft_graph_collapseProperty).describe(
2908
+ "Contains the ordered collection of fields and limit to collapse results. Optional."
2909
+ ).optional(),
2910
+ contentSources: z.array(z.string().nullable()).describe("Contains the connection to be targeted.").optional(),
2911
+ enableTopResults: z.boolean().describe(
2912
+ "This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional."
2913
+ ).nullish(),
2914
+ entityTypes: z.array(z.union([microsoft_graph_entityType, z.object({}).partial().strict()])).describe(
2915
+ "One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: chatMessage, person, acronym, bookmark. See known limitations for those combinations of two or more entity types that are supported in the same search request. Required."
2916
+ ).optional(),
2917
+ fields: z.array(z.string().nullable()).describe(
2918
+ "Contains the fields to be returned for each resource object specified in entityTypes, allowing customization of the fields returned by default; otherwise, including additional fields such as custom managed properties from SharePoint and OneDrive, or custom fields in externalItem from the content that Microsoft 365 Copilot connectors bring in. The fields property can use the semantic labels applied to properties. For example, if a property is labeled as title, you can retrieve it using the following syntax: label_title. Optional."
2919
+ ).optional(),
2920
+ from: z.number().gte(-2147483648).lte(2147483647).describe(
2921
+ "Specifies the offset for the search results. Offset 0 returns the very first result. Optional."
2922
+ ).optional(),
2923
+ query: microsoft_graph_searchQuery.optional(),
2924
+ queryAlterationOptions: microsoft_graph_searchAlterationOptions.optional(),
2925
+ region: z.string().describe(
2926
+ "The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value."
2927
+ ).nullish(),
2928
+ resultTemplateOptions: microsoft_graph_resultTemplateOption.optional(),
2929
+ sharePointOneDriveOptions: microsoft_graph_sharePointOneDriveOptions.optional(),
2930
+ size: z.number().gte(-2147483648).lte(2147483647).describe("The size of the page to be retrieved. The maximum value is 500. Optional.").optional(),
2931
+ sortProperties: z.array(microsoft_graph_sortProperty).describe(
2932
+ "Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional."
2933
+ ).optional()
2934
+ }).strict();
2935
+ const search_query_Body = z.object({ requests: z.array(microsoft_graph_searchRequest) }).partial().strict();
2936
+ const BaseCollectionPaginationCountResponse = z.object({ "@odata.count": z.number().int().nullable(), "@odata.nextLink": z.string().nullable() }).partial().strict();
2937
+ const microsoft_graph_searchBucket = z.object({
2938
+ aggregationFilterToken: z.string().describe(
2939
+ "A token containing the encoded filter to aggregate search matches by the specific key value. To use the filter, pass the token as part of the aggregationFilter property in a searchRequest object, in the format '{field}:/'{aggregationFilterToken}/''. See an example."
2940
+ ).nullish(),
2941
+ count: z.number().gte(-2147483648).lte(2147483647).describe(
2942
+ "The approximate number of search matches that share the same value specified in the key property. Note that this number is not the exact number of matches."
2943
+ ).nullish(),
2944
+ key: z.string().describe("The discrete value of the field that an aggregation was computed on.").nullish()
2945
+ }).strict();
2946
+ const microsoft_graph_searchAggregation = z.object({
2947
+ buckets: z.array(microsoft_graph_searchBucket).optional(),
2948
+ field: z.string().nullish()
2949
+ }).strict();
2950
+ const microsoft_graph_entity = z.object({ id: z.string().describe("The unique identifier for an entity. Read-only.").optional() }).strict();
2951
+ const microsoft_graph_searchHit = z.object({
2952
+ contentSource: z.string().describe("The name of the content source that the externalItem is part of.").nullish(),
2953
+ hitId: z.string().describe(
2954
+ "The internal identifier for the item. The format of the identifier varies based on the entity type. For details, see hitId format."
2955
+ ).nullish(),
2956
+ isCollapsed: z.boolean().describe(
2957
+ "Indicates whether the current result is collapsed when the collapseProperties property in the searchRequest is used."
2958
+ ).nullish(),
2959
+ rank: z.number().gte(-2147483648).lte(2147483647).describe("The rank or the order of the result.").nullish(),
2960
+ resultTemplateId: z.string().describe(
2961
+ "ID of the result template used to render the search result. This ID must map to a display layout in the resultTemplates dictionary that is also included in the searchResponse."
2962
+ ).nullish(),
2963
+ summary: z.string().describe("A summary of the result, if a summary is available.").nullish(),
2964
+ resource: microsoft_graph_entity.optional()
2965
+ }).strict();
2966
+ const microsoft_graph_searchHitsContainer = z.object({
2967
+ aggregations: z.array(microsoft_graph_searchAggregation).optional(),
2968
+ hits: z.array(microsoft_graph_searchHit).describe("A collection of the search results.").optional(),
2969
+ moreResultsAvailable: z.boolean().describe(
2970
+ "Provides information if more results are available. Based on this information, you can adjust the from and size properties of the searchRequest accordingly."
2971
+ ).nullish(),
2972
+ total: z.number().gte(-2147483648).lte(2147483647).describe(
2973
+ "The total number of results. Note this isn't the number of results on the page, but the total number of results satisfying the query."
2974
+ ).nullish()
2975
+ }).strict();
2976
+ const microsoft_graph_alteredQueryToken = z.object({
2977
+ length: z.number().gte(-2147483648).lte(2147483647).describe("Defines the length of a changed segment.").nullish(),
2978
+ offset: z.number().gte(-2147483648).lte(2147483647).describe("Defines the offset of a changed segment.").nullish(),
2979
+ suggestion: z.string().describe("Represents the corrected segment string.").nullish()
2980
+ }).strict();
2981
+ const microsoft_graph_searchAlteration = z.object({
2982
+ alteredHighlightedQueryString: z.string().describe(
2983
+ "Defines the altered highlighted query string with spelling correction. The annotation around the corrected segment is: /ue000, /ue001."
2984
+ ).nullish(),
2985
+ alteredQueryString: z.string().describe("Defines the altered query string with spelling correction.").nullish(),
2986
+ alteredQueryTokens: z.array(microsoft_graph_alteredQueryToken).describe("Represents changed segments related to an original user query.").optional()
2987
+ }).strict();
2988
+ const microsoft_graph_searchAlterationType = z.enum([
2989
+ "suggestion",
2990
+ "modification",
2991
+ "unknownFutureValue"
2992
+ ]);
2993
+ const microsoft_graph_alterationResponse = z.object({
2994
+ originalQueryString: z.string().describe("Defines the original user query string.").nullish(),
2995
+ queryAlteration: microsoft_graph_searchAlteration.optional(),
2996
+ queryAlterationType: microsoft_graph_searchAlterationType.optional()
2997
+ }).strict();
2998
+ const microsoft_graph_resultTemplateDictionary = z.object({}).strict();
2999
+ const microsoft_graph_searchResponse = z.object({
3000
+ hitsContainers: z.array(microsoft_graph_searchHitsContainer).describe("A collection of search results.").optional(),
3001
+ queryAlterationResponse: microsoft_graph_alterationResponse.optional(),
3002
+ resultTemplates: microsoft_graph_resultTemplateDictionary.optional(),
3003
+ searchTerms: z.array(z.string().nullable()).describe("Contains the search terms sent in the initial search query.").optional()
3004
+ }).strict();
2831
3005
  const microsoft_graph_root = z.object({}).strict();
2832
3006
  const microsoft_graph_siteArchiveStatus = z.enum([
2833
3007
  "recentlyArchived",
@@ -2919,6 +3093,7 @@ const microsoft_graph_listItemCollectionResponse = z.object({
2919
3093
  "@odata.nextLink": z.string().nullable(),
2920
3094
  value: z.array(microsoft_graph_listItem)
2921
3095
  }).partial().strict();
3096
+ const BaseDeltaFunctionResponse = z.object({ "@odata.nextLink": z.string().nullable(), "@odata.deltaLink": z.string().nullable() }).partial().strict();
2922
3097
  const microsoft_graph_channelCollectionResponse = z.object({
2923
3098
  "@odata.count": z.number().int().nullable(),
2924
3099
  "@odata.nextLink": z.string().nullable(),
@@ -3208,7 +3383,32 @@ const schemas = {
3208
3383
  microsoft_graph_plannerUserIds,
3209
3384
  microsoft_graph_plannerPlanDetails,
3210
3385
  microsoft_graph_plannerPlan,
3386
+ microsoft_graph_bucketAggregationRange,
3387
+ microsoft_graph_bucketAggregationSortProperty,
3388
+ microsoft_graph_bucketAggregationDefinition,
3389
+ microsoft_graph_aggregationOption,
3390
+ microsoft_graph_collapseProperty,
3391
+ microsoft_graph_entityType,
3392
+ microsoft_graph_searchQuery,
3393
+ microsoft_graph_searchAlterationOptions,
3394
+ microsoft_graph_resultTemplateOption,
3395
+ microsoft_graph_searchContent,
3396
+ microsoft_graph_sharePointOneDriveOptions,
3397
+ microsoft_graph_sortProperty,
3398
+ microsoft_graph_searchRequest,
3211
3399
  search_query_Body,
3400
+ BaseCollectionPaginationCountResponse,
3401
+ microsoft_graph_searchBucket,
3402
+ microsoft_graph_searchAggregation,
3403
+ microsoft_graph_entity,
3404
+ microsoft_graph_searchHit,
3405
+ microsoft_graph_searchHitsContainer,
3406
+ microsoft_graph_alteredQueryToken,
3407
+ microsoft_graph_searchAlteration,
3408
+ microsoft_graph_searchAlterationType,
3409
+ microsoft_graph_alterationResponse,
3410
+ microsoft_graph_resultTemplateDictionary,
3411
+ microsoft_graph_searchResponse,
3212
3412
  microsoft_graph_root,
3213
3413
  microsoft_graph_siteArchiveStatus,
3214
3414
  microsoft_graph_siteArchivalDetails,
@@ -3219,6 +3419,7 @@ const schemas = {
3219
3419
  microsoft_graph_baseItemCollectionResponse,
3220
3420
  microsoft_graph_listCollectionResponse,
3221
3421
  microsoft_graph_listItemCollectionResponse,
3422
+ BaseDeltaFunctionResponse,
3222
3423
  microsoft_graph_channelCollectionResponse,
3223
3424
  microsoft_graph_conversationMemberCollectionResponse
3224
3425
  };
@@ -3331,7 +3532,7 @@ const endpoints = makeApi([
3331
3532
  method: "post",
3332
3533
  path: "/chats/:chatId/messages",
3333
3534
  alias: "send-chat-message",
3334
- description: `Send a new chatMessage in the specified channel or a chat.`,
3535
+ description: `Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.`,
3335
3536
  requestFormat: "json",
3336
3537
  parameters: [
3337
3538
  {
@@ -4793,8 +4994,13 @@ get the instances of an event. Currently, this operation returns event bodies in
4793
4994
  method: "post",
4794
4995
  path: "/me/events",
4795
4996
  alias: "create-calendar-event",
4796
- description: `Create one or more single-value extended properties in a new or existing instance of a resource. The following user resources are supported: The following group resources: See Extended properties overview for more information about when to use
4797
- open extensions or extended properties, and how to specify extended properties.`,
4997
+ description: `Create an event in the user's default calendar or specified calendar. By default, the allowNewTimeProposals property is set to true when an event is created, which means invitees can propose a different date/time for the event. See Propose new meeting times for more information on how to propose a time, and how to receive and accept a new time proposal. You can specify the time zone for each of the start and end times of the event as part of their values, because the
4998
+ start and end properties are of dateTimeTimeZone type. First find the supported time zones to make sure you set only time zones that have been configured for the user's mailbox server. When an event is sent, the server sends invitations to all the attendees. Setting the location in an event An Exchange administrator can set up a mailbox and an email address for a resource such as a meeting room, or equipment
4999
+ like a projector. Users can then invite the resource as an attendee to a meeting. On behalf of the resource, the server accepts or rejects
5000
+ the meeting request based on the free/busy schedule of the resource.
5001
+ If the server accepts a meeting for the resource, it creates an event for the meeting in the resource's calendar. If the meeting is rescheduled,
5002
+ the server automatically updates the event in the resource's calendar. Another advantage of setting up a mailbox for a resource is to control scheduling of the resource, for example, only executives
5003
+ or their delegates can book a private meeting room. If you're organizing an event that involves a meeting location: Additionally, if the meeting location has been set up as a resource, or if the event involves some equipment that has been set up as a resource:`,
4798
5004
  requestFormat: "json",
4799
5005
  parameters: [
4800
5006
  {
@@ -5452,11 +5658,7 @@ open extensions or extended properties, and how to specify extended properties.`
5452
5658
  method: "post",
5453
5659
  path: "/me/messages",
5454
5660
  alias: "create-draft-email",
5455
- description: `Create a draft of a new message in either JSON or MIME format. When using JSON format, you can:
5456
- - Include an attachment to the message.
5457
- - Update the draft later to add content to the body or change other message properties. When using MIME format:
5458
- - Provide the applicable Internet message headers and the MIME content, all encoded in base64 format in the request body.
5459
- - /* Add any attachments and S/MIME properties to the MIME content. By default, this operation saves the draft in the Drafts folder. Send the draft message in a subsequent operation. Alternatively, send a new message in a single operation, or create a draft to forward, reply and reply-all to an existing message.`,
5661
+ description: `Create an open extension (openTypeExtension object) and add custom properties in a new or existing instance of a resource. You can create an open extension in a resource instance and store custom data to it all in the same operation, except for specific resources. The table in the Permissions section lists the resources that support open extensions.`,
5460
5662
  requestFormat: "json",
5461
5663
  parameters: [
5462
5664
  {
@@ -5652,7 +5854,7 @@ open extensions or extended properties, and how to specify extended properties.`
5652
5854
  method: "delete",
5653
5855
  path: "/me/messages/:messageId",
5654
5856
  alias: "delete-mail-message",
5655
- description: `Delete a message in the specified user's mailbox, or delete a relationship of the message.`,
5857
+ description: `Delete eventMessage.`,
5656
5858
  requestFormat: "json",
5657
5859
  parameters: [
5658
5860
  {
@@ -6925,7 +7127,9 @@ open extensions or extended properties, and how to specify extended properties.`
6925
7127
  {
6926
7128
  status: NaN,
6927
7129
  description: `Success`,
6928
- schema: z.object({ value: z.array(z.object({}).partial().strict()) }).partial().strict()
7130
+ schema: BaseCollectionPaginationCountResponse.and(
7131
+ z.object({ value: z.array(microsoft_graph_searchResponse) }).partial().strict()
7132
+ )
6929
7133
  },
6930
7134
  {
6931
7135
  status: NaN,
@@ -7617,7 +7821,9 @@ To monitor future changes, call the delta API by using the @odata.deltaLink in t
7617
7821
  {
7618
7822
  status: NaN,
7619
7823
  description: `Success`,
7620
- schema: z.object({ value: z.array(microsoft_graph_site) }).partial().strict()
7824
+ schema: BaseDeltaFunctionResponse.and(
7825
+ z.object({ value: z.array(microsoft_graph_site) }).partial().strict()
7826
+ )
7621
7827
  },
7622
7828
  {
7623
7829
  status: NaN,
@@ -7881,7 +8087,7 @@ To monitor future changes, call the delta API by using the @odata.deltaLink in t
7881
8087
  method: "post",
7882
8088
  path: "/teams/:teamId/channels/:channelId/messages",
7883
8089
  alias: "send-channel-message",
7884
- description: `Send a new chatMessage in the specified channel or a chat.`,
8090
+ description: `Send a new chatMessage in the specified channel.`,
7885
8091
  requestFormat: "json",
7886
8092
  parameters: [
7887
8093
  {
@@ -36,11 +36,7 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
36
36
  const paramSchema = {};
37
37
  if (tool.parameters && tool.parameters.length > 0) {
38
38
  for (const param of tool.parameters) {
39
- if (param.type === "Body" && param.schema) {
40
- paramSchema[param.name] = z.union([z.string(), param.schema]);
41
- } else {
42
- paramSchema[param.name] = param.schema || z.any();
43
- }
39
+ paramSchema[param.name] = param.schema || z.any();
44
40
  }
45
41
  }
46
42
  if (tool.method.toUpperCase() === "GET" && tool.path.includes("/")) {
@@ -89,31 +85,15 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
89
85
  queryParams[fixedParamName] = `${paramValue}`;
90
86
  break;
91
87
  case "Body":
92
- if (typeof paramValue === "string") {
93
- try {
94
- body = JSON.parse(paramValue);
95
- } catch {
96
- body = paramValue;
97
- }
98
- } else {
99
- body = paramValue;
100
- }
88
+ body = paramValue;
101
89
  break;
102
90
  case "Header":
103
91
  headers[fixedParamName] = `${paramValue}`;
104
92
  break;
105
93
  }
106
94
  } else if (paramName === "body") {
107
- if (typeof paramValue === "string") {
108
- try {
109
- body = JSON.parse(paramValue);
110
- } catch {
111
- body = paramValue;
112
- }
113
- } else {
114
- body = paramValue;
115
- }
116
- logger.info(`Set legacy body param: ${JSON.stringify(body)}`);
95
+ body = paramValue;
96
+ logger.info(`Set body param: ${JSON.stringify(body)}`);
117
97
  }
118
98
  }
119
99
  if (Object.keys(queryParams).length > 0) {
package/dist/server.js CHANGED
@@ -239,37 +239,76 @@ class MicrosoftGraphServer {
239
239
  issuerUrl: new URL(`http://localhost:${port}`)
240
240
  })
241
241
  );
242
- app.post("/mcp", microsoftBearerTokenAuthMiddleware, async (req, res) => {
243
- try {
244
- if (req.microsoftAuth) {
245
- this.graphClient.setOAuthTokens(
246
- req.microsoftAuth.accessToken,
247
- req.microsoftAuth.refreshToken
248
- );
242
+ app.get(
243
+ "/mcp",
244
+ microsoftBearerTokenAuthMiddleware,
245
+ async (req, res) => {
246
+ try {
247
+ if (req.microsoftAuth) {
248
+ this.graphClient.setOAuthTokens(
249
+ req.microsoftAuth.accessToken,
250
+ req.microsoftAuth.refreshToken
251
+ );
252
+ }
253
+ const transport = new StreamableHTTPServerTransport({
254
+ sessionIdGenerator: void 0
255
+ // Stateless mode
256
+ });
257
+ res.on("close", () => {
258
+ transport.close();
259
+ });
260
+ await this.server.connect(transport);
261
+ await transport.handleRequest(req, res, void 0);
262
+ } catch (error) {
263
+ logger.error("Error handling MCP GET request:", error);
264
+ if (!res.headersSent) {
265
+ res.status(500).json({
266
+ jsonrpc: "2.0",
267
+ error: {
268
+ code: -32603,
269
+ message: "Internal server error"
270
+ },
271
+ id: null
272
+ });
273
+ }
249
274
  }
250
- const transport = new StreamableHTTPServerTransport({
251
- sessionIdGenerator: void 0
252
- // Stateless mode
253
- });
254
- res.on("close", () => {
255
- transport.close();
256
- });
257
- await this.server.connect(transport);
258
- await transport.handleRequest(req, res, req.body);
259
- } catch (error) {
260
- logger.error("Error handling MCP request:", error);
261
- if (!res.headersSent) {
262
- res.status(500).json({
263
- jsonrpc: "2.0",
264
- error: {
265
- code: -32603,
266
- message: "Internal server error"
267
- },
268
- id: null
275
+ }
276
+ );
277
+ app.post(
278
+ "/mcp",
279
+ microsoftBearerTokenAuthMiddleware,
280
+ async (req, res) => {
281
+ try {
282
+ if (req.microsoftAuth) {
283
+ this.graphClient.setOAuthTokens(
284
+ req.microsoftAuth.accessToken,
285
+ req.microsoftAuth.refreshToken
286
+ );
287
+ }
288
+ const transport = new StreamableHTTPServerTransport({
289
+ sessionIdGenerator: void 0
290
+ // Stateless mode
291
+ });
292
+ res.on("close", () => {
293
+ transport.close();
269
294
  });
295
+ await this.server.connect(transport);
296
+ await transport.handleRequest(req, res, req.body);
297
+ } catch (error) {
298
+ logger.error("Error handling MCP POST request:", error);
299
+ if (!res.headersSent) {
300
+ res.status(500).json({
301
+ jsonrpc: "2.0",
302
+ error: {
303
+ code: -32603,
304
+ message: "Internal server error"
305
+ },
306
+ id: null
307
+ });
308
+ }
270
309
  }
271
310
  }
272
- });
311
+ );
273
312
  app.get("/", (req, res) => {
274
313
  res.send("Microsoft 365 MCP Server is running");
275
314
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
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",