@softeria/ms-365-mcp-server 0.16.0 → 0.18.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.
- package/README.md +21 -0
- package/bin/modules/simplified-openapi.mjs +22 -0
- package/dist/endpoints.json +30 -0
- package/dist/generated/client.js +564 -15
- package/dist/graph-tools.js +4 -24
- package/package.json +1 -1
- package/src/endpoints.json +30 -0
package/README.md
CHANGED
|
@@ -71,6 +71,13 @@ get-sharepoint-site-drive-by-id, list-sharepoint-site-items, get-sharepoint-site
|
|
|
71
71
|
get-sharepoint-site-list, list-sharepoint-site-list-items, get-sharepoint-site-list-item,
|
|
72
72
|
get-sharepoint-sites-delta</sub>
|
|
73
73
|
|
|
74
|
+
**Shared Mailboxes**
|
|
75
|
+
<sub>list-shared-mailbox-messages, list-shared-mailbox-folder-messages, get-shared-mailbox-message,
|
|
76
|
+
send-shared-mailbox-mail</sub>
|
|
77
|
+
|
|
78
|
+
**User Management**
|
|
79
|
+
<sub>list-users</sub>
|
|
80
|
+
|
|
74
81
|
## Organization/Work Mode
|
|
75
82
|
|
|
76
83
|
To access work/school features (Teams, SharePoint, etc.), enable organization mode using any of these flags:
|
|
@@ -89,6 +96,20 @@ To access work/school features (Teams, SharePoint, etc.), enable organization mo
|
|
|
89
96
|
Organization mode must be enabled from the start to access work account features. Without this flag, only personal
|
|
90
97
|
account features (email, calendar, OneDrive, etc.) are available.
|
|
91
98
|
|
|
99
|
+
## Shared Mailbox Access
|
|
100
|
+
|
|
101
|
+
To access shared mailboxes, you need:
|
|
102
|
+
|
|
103
|
+
1. **Organization mode**: Shared mailbox tools require `--org-mode` flag (work/school accounts only)
|
|
104
|
+
2. **Delegated permissions**: `Mail.Read.Shared` or `Mail.Send.Shared` scopes
|
|
105
|
+
3. **Exchange permissions**: The signed-in user must have been granted access to the shared mailbox
|
|
106
|
+
4. **Usage**: Use the shared mailbox's email address as the `user-id` parameter in the shared mailbox tools
|
|
107
|
+
|
|
108
|
+
**Finding shared mailboxes**: Use the `list-users` tool to discover available users and shared mailboxes in your
|
|
109
|
+
organization.
|
|
110
|
+
|
|
111
|
+
Example: `list-shared-mailbox-messages` with `user-id` set to `shared-mailbox@company.com`
|
|
112
|
+
|
|
92
113
|
## Quick Start Example
|
|
93
114
|
|
|
94
115
|
Test login in Claude Desktop:
|
|
@@ -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
|
});
|
package/dist/endpoints.json
CHANGED
|
@@ -29,6 +29,36 @@
|
|
|
29
29
|
"toolName": "send-mail",
|
|
30
30
|
"scopes": ["Mail.Send"]
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"pathPattern": "/users/{user-id}/messages",
|
|
34
|
+
"method": "get",
|
|
35
|
+
"toolName": "list-shared-mailbox-messages",
|
|
36
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"pathPattern": "/users/{user-id}/mailFolders/{mailFolder-id}/messages",
|
|
40
|
+
"method": "get",
|
|
41
|
+
"toolName": "list-shared-mailbox-folder-messages",
|
|
42
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"pathPattern": "/users/{user-id}/messages/{message-id}",
|
|
46
|
+
"method": "get",
|
|
47
|
+
"toolName": "get-shared-mailbox-message",
|
|
48
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"pathPattern": "/users/{user-id}/sendMail",
|
|
52
|
+
"method": "post",
|
|
53
|
+
"toolName": "send-shared-mailbox-mail",
|
|
54
|
+
"workScopes": ["Mail.Send.Shared"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"pathPattern": "/users",
|
|
58
|
+
"method": "get",
|
|
59
|
+
"toolName": "list-users",
|
|
60
|
+
"workScopes": ["User.Read.All"]
|
|
61
|
+
},
|
|
32
62
|
{
|
|
33
63
|
"pathPattern": "/me/messages",
|
|
34
64
|
"method": "post",
|
package/dist/generated/client.js
CHANGED
|
@@ -355,7 +355,7 @@ const microsoft_graph_teamsTab = z.object({
|
|
|
355
355
|
id: z.string().describe("The unique identifier for an entity. Read-only.").optional(),
|
|
356
356
|
configuration: microsoft_graph_teamsTabConfiguration.optional(),
|
|
357
357
|
displayName: z.string().describe("Name of the tab.").nullish(),
|
|
358
|
-
webUrl: z.string().describe("Deep link URL of the tab instance. Read
|
|
358
|
+
webUrl: z.string().describe("Deep link URL of the tab instance. Read-only.").nullish(),
|
|
359
359
|
teamsApp: microsoft_graph_teamsApp.optional()
|
|
360
360
|
}).strict();
|
|
361
361
|
const microsoft_graph_chat = z.object({
|
|
@@ -2805,7 +2805,203 @@ const microsoft_graph_plannerPlan = z.object({
|
|
|
2805
2805
|
details: microsoft_graph_plannerPlanDetails.optional(),
|
|
2806
2806
|
tasks: z.array(microsoft_graph_plannerTask).describe("Read-only. Nullable. Collection of tasks in the plan.").optional()
|
|
2807
2807
|
}).strict();
|
|
2808
|
-
const
|
|
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();
|
|
2809
3005
|
const microsoft_graph_root = z.object({}).strict();
|
|
2810
3006
|
const microsoft_graph_siteArchiveStatus = z.enum([
|
|
2811
3007
|
"recentlyArchived",
|
|
@@ -2897,6 +3093,7 @@ const microsoft_graph_listItemCollectionResponse = z.object({
|
|
|
2897
3093
|
"@odata.nextLink": z.string().nullable(),
|
|
2898
3094
|
value: z.array(microsoft_graph_listItem)
|
|
2899
3095
|
}).partial().strict();
|
|
3096
|
+
const BaseDeltaFunctionResponse = z.object({ "@odata.nextLink": z.string().nullable(), "@odata.deltaLink": z.string().nullable() }).partial().strict();
|
|
2900
3097
|
const microsoft_graph_channelCollectionResponse = z.object({
|
|
2901
3098
|
"@odata.count": z.number().int().nullable(),
|
|
2902
3099
|
"@odata.nextLink": z.string().nullable(),
|
|
@@ -2907,6 +3104,11 @@ const microsoft_graph_conversationMemberCollectionResponse = z.object({
|
|
|
2907
3104
|
"@odata.nextLink": z.string().nullable(),
|
|
2908
3105
|
value: z.array(microsoft_graph_conversationMember)
|
|
2909
3106
|
}).partial().strict();
|
|
3107
|
+
const microsoft_graph_userCollectionResponse = z.object({
|
|
3108
|
+
"@odata.count": z.number().int().nullable(),
|
|
3109
|
+
"@odata.nextLink": z.string().nullable(),
|
|
3110
|
+
value: z.array(microsoft_graph_user)
|
|
3111
|
+
}).partial().strict();
|
|
2910
3112
|
const schemas = {
|
|
2911
3113
|
microsoft_graph_chatType,
|
|
2912
3114
|
microsoft_graph_teamworkUserIdentityType,
|
|
@@ -3186,7 +3388,32 @@ const schemas = {
|
|
|
3186
3388
|
microsoft_graph_plannerUserIds,
|
|
3187
3389
|
microsoft_graph_plannerPlanDetails,
|
|
3188
3390
|
microsoft_graph_plannerPlan,
|
|
3391
|
+
microsoft_graph_bucketAggregationRange,
|
|
3392
|
+
microsoft_graph_bucketAggregationSortProperty,
|
|
3393
|
+
microsoft_graph_bucketAggregationDefinition,
|
|
3394
|
+
microsoft_graph_aggregationOption,
|
|
3395
|
+
microsoft_graph_collapseProperty,
|
|
3396
|
+
microsoft_graph_entityType,
|
|
3397
|
+
microsoft_graph_searchQuery,
|
|
3398
|
+
microsoft_graph_searchAlterationOptions,
|
|
3399
|
+
microsoft_graph_resultTemplateOption,
|
|
3400
|
+
microsoft_graph_searchContent,
|
|
3401
|
+
microsoft_graph_sharePointOneDriveOptions,
|
|
3402
|
+
microsoft_graph_sortProperty,
|
|
3403
|
+
microsoft_graph_searchRequest,
|
|
3189
3404
|
search_query_Body,
|
|
3405
|
+
BaseCollectionPaginationCountResponse,
|
|
3406
|
+
microsoft_graph_searchBucket,
|
|
3407
|
+
microsoft_graph_searchAggregation,
|
|
3408
|
+
microsoft_graph_entity,
|
|
3409
|
+
microsoft_graph_searchHit,
|
|
3410
|
+
microsoft_graph_searchHitsContainer,
|
|
3411
|
+
microsoft_graph_alteredQueryToken,
|
|
3412
|
+
microsoft_graph_searchAlteration,
|
|
3413
|
+
microsoft_graph_searchAlterationType,
|
|
3414
|
+
microsoft_graph_alterationResponse,
|
|
3415
|
+
microsoft_graph_resultTemplateDictionary,
|
|
3416
|
+
microsoft_graph_searchResponse,
|
|
3190
3417
|
microsoft_graph_root,
|
|
3191
3418
|
microsoft_graph_siteArchiveStatus,
|
|
3192
3419
|
microsoft_graph_siteArchivalDetails,
|
|
@@ -3197,8 +3424,10 @@ const schemas = {
|
|
|
3197
3424
|
microsoft_graph_baseItemCollectionResponse,
|
|
3198
3425
|
microsoft_graph_listCollectionResponse,
|
|
3199
3426
|
microsoft_graph_listItemCollectionResponse,
|
|
3427
|
+
BaseDeltaFunctionResponse,
|
|
3200
3428
|
microsoft_graph_channelCollectionResponse,
|
|
3201
|
-
microsoft_graph_conversationMemberCollectionResponse
|
|
3429
|
+
microsoft_graph_conversationMemberCollectionResponse,
|
|
3430
|
+
microsoft_graph_userCollectionResponse
|
|
3202
3431
|
};
|
|
3203
3432
|
const endpoints = makeApi([
|
|
3204
3433
|
{
|
|
@@ -3938,7 +4167,7 @@ const endpoints = makeApi([
|
|
|
3938
4167
|
method: "get",
|
|
3939
4168
|
path: "/me",
|
|
3940
4169
|
alias: "get-current-user",
|
|
3941
|
-
description: `
|
|
4170
|
+
description: `Returns the user or organizational contact assigned as the user's manager. Optionally, you can expand the manager's chain up to the root node.`,
|
|
3942
4171
|
requestFormat: "json",
|
|
3943
4172
|
parameters: [
|
|
3944
4173
|
{
|
|
@@ -5435,7 +5664,11 @@ or their delegates can book a private meeting room. If you're organizing an
|
|
|
5435
5664
|
method: "post",
|
|
5436
5665
|
path: "/me/messages",
|
|
5437
5666
|
alias: "create-draft-email",
|
|
5438
|
-
description: `Create
|
|
5667
|
+
description: `Create a draft of a new message in either JSON or MIME format. When using JSON format, you can:
|
|
5668
|
+
- Include an attachment to the message.
|
|
5669
|
+
- Update the draft later to add content to the body or change other message properties. When using MIME format:
|
|
5670
|
+
- Provide the applicable Internet message headers and the MIME content, all encoded in base64 format in the request body.
|
|
5671
|
+
- /* 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.`,
|
|
5439
5672
|
requestFormat: "json",
|
|
5440
5673
|
parameters: [
|
|
5441
5674
|
{
|
|
@@ -5548,13 +5781,7 @@ or their delegates can book a private meeting room. If you're organizing an
|
|
|
5548
5781
|
method: "get",
|
|
5549
5782
|
path: "/me/messages/:messageId",
|
|
5550
5783
|
alias: "get-mail-message",
|
|
5551
|
-
description: `
|
|
5552
|
-
that include extended properties matching a filter. Using the query parameter $expand allows you to get the specified resource instance expanded with a specific extended
|
|
5553
|
-
property. Use a $filter and eq operator on the id property to specify the extended property. This is currently the only way to get the singleValueLegacyExtendedProperty object that represents an extended property. To get resource instances that have certain extended properties, use the $filter query parameter and apply an eq operator
|
|
5554
|
-
on the id property. In addition, for numeric extended properties, apply one of the following operators on the value property:
|
|
5555
|
-
eq, ne,ge, gt, le, or lt. For string-typed extended properties, apply a contains, startswith, eq, or ne operator on value. The filter is applied to all instances of the resource in the signed-in user's mailbox. Filtering the string name (Name) in the id of an extended property is case-sensitive. Filtering the value property of an extended
|
|
5556
|
-
property is case-insensitive. The following user resources are supported: As well as the following group resources: See Extended properties overview for more information about when to use
|
|
5557
|
-
open extensions or extended properties, and how to specify extended properties.`,
|
|
5784
|
+
description: `Get the properties and relationships of the eventMessage object. Apply the $expand parameter on the event navigation property to get the associated event in an attendee's calendar. Currently, this operation returns event message bodies in only HTML format.`,
|
|
5558
5785
|
requestFormat: "json",
|
|
5559
5786
|
parameters: [
|
|
5560
5787
|
{
|
|
@@ -6322,7 +6549,7 @@ open extensions or extended properties, and how to specify extended properties.`
|
|
|
6322
6549
|
method: "delete",
|
|
6323
6550
|
path: "/me/todo/lists/:todoTaskListId/tasks/:todoTaskId",
|
|
6324
6551
|
alias: "delete-todo-task",
|
|
6325
|
-
description: `
|
|
6552
|
+
description: `Delete a todoTask object.`,
|
|
6326
6553
|
requestFormat: "json",
|
|
6327
6554
|
parameters: [
|
|
6328
6555
|
{
|
|
@@ -6904,7 +7131,9 @@ open extensions or extended properties, and how to specify extended properties.`
|
|
|
6904
7131
|
{
|
|
6905
7132
|
status: NaN,
|
|
6906
7133
|
description: `Success`,
|
|
6907
|
-
schema:
|
|
7134
|
+
schema: BaseCollectionPaginationCountResponse.and(
|
|
7135
|
+
z.object({ value: z.array(microsoft_graph_searchResponse) }).partial().strict()
|
|
7136
|
+
)
|
|
6908
7137
|
},
|
|
6909
7138
|
{
|
|
6910
7139
|
status: NaN,
|
|
@@ -7596,7 +7825,9 @@ To monitor future changes, call the delta API by using the @odata.deltaLink in t
|
|
|
7596
7825
|
{
|
|
7597
7826
|
status: NaN,
|
|
7598
7827
|
description: `Success`,
|
|
7599
|
-
schema:
|
|
7828
|
+
schema: BaseDeltaFunctionResponse.and(
|
|
7829
|
+
z.object({ value: z.array(microsoft_graph_site) }).partial().strict()
|
|
7830
|
+
)
|
|
7600
7831
|
},
|
|
7601
7832
|
{
|
|
7602
7833
|
status: NaN,
|
|
@@ -7992,6 +8223,324 @@ To monitor future changes, call the delta API by using the @odata.deltaLink in t
|
|
|
7992
8223
|
schema: microsoft_graph_ODataErrors_ODataError
|
|
7993
8224
|
}
|
|
7994
8225
|
]
|
|
8226
|
+
},
|
|
8227
|
+
{
|
|
8228
|
+
method: "get",
|
|
8229
|
+
path: "/users",
|
|
8230
|
+
alias: "list-users",
|
|
8231
|
+
description: `List properties and relationships of the user objects.`,
|
|
8232
|
+
requestFormat: "json",
|
|
8233
|
+
parameters: [
|
|
8234
|
+
{
|
|
8235
|
+
name: "ConsistencyLevel",
|
|
8236
|
+
type: "Header",
|
|
8237
|
+
schema: z.string().describe(
|
|
8238
|
+
"Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries"
|
|
8239
|
+
).optional()
|
|
8240
|
+
},
|
|
8241
|
+
{
|
|
8242
|
+
name: "$top",
|
|
8243
|
+
type: "Query",
|
|
8244
|
+
schema: z.number().int().gte(0).describe("Show only the first n items").optional()
|
|
8245
|
+
},
|
|
8246
|
+
{
|
|
8247
|
+
name: "$search",
|
|
8248
|
+
type: "Query",
|
|
8249
|
+
schema: z.string().describe("Search items by search phrases").optional()
|
|
8250
|
+
},
|
|
8251
|
+
{
|
|
8252
|
+
name: "$filter",
|
|
8253
|
+
type: "Query",
|
|
8254
|
+
schema: z.string().describe("Filter items by property values").optional()
|
|
8255
|
+
},
|
|
8256
|
+
{
|
|
8257
|
+
name: "$count",
|
|
8258
|
+
type: "Query",
|
|
8259
|
+
schema: z.boolean().describe("Include count of items").optional()
|
|
8260
|
+
},
|
|
8261
|
+
{
|
|
8262
|
+
name: "$orderby",
|
|
8263
|
+
type: "Query",
|
|
8264
|
+
schema: z.array(z.string()).describe("Order items by property values").optional()
|
|
8265
|
+
},
|
|
8266
|
+
{
|
|
8267
|
+
name: "$select",
|
|
8268
|
+
type: "Query",
|
|
8269
|
+
schema: z.array(z.string()).describe("Select properties to be returned").optional()
|
|
8270
|
+
},
|
|
8271
|
+
{
|
|
8272
|
+
name: "$expand",
|
|
8273
|
+
type: "Query",
|
|
8274
|
+
schema: z.array(z.string()).describe("Expand related entities").optional()
|
|
8275
|
+
}
|
|
8276
|
+
],
|
|
8277
|
+
response: z.void(),
|
|
8278
|
+
errors: [
|
|
8279
|
+
{
|
|
8280
|
+
status: NaN,
|
|
8281
|
+
description: `Retrieved collection`,
|
|
8282
|
+
schema: microsoft_graph_userCollectionResponse
|
|
8283
|
+
},
|
|
8284
|
+
{
|
|
8285
|
+
status: NaN,
|
|
8286
|
+
description: `error`,
|
|
8287
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8288
|
+
},
|
|
8289
|
+
{
|
|
8290
|
+
status: NaN,
|
|
8291
|
+
description: `error`,
|
|
8292
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8293
|
+
}
|
|
8294
|
+
]
|
|
8295
|
+
},
|
|
8296
|
+
{
|
|
8297
|
+
method: "get",
|
|
8298
|
+
path: "/users/:userId/mailFolders/:mailFolderId/messages",
|
|
8299
|
+
alias: "list-shared-mailbox-folder-messages",
|
|
8300
|
+
description: `The collection of messages in the mailFolder.`,
|
|
8301
|
+
requestFormat: "json",
|
|
8302
|
+
parameters: [
|
|
8303
|
+
{
|
|
8304
|
+
name: "$top",
|
|
8305
|
+
type: "Query",
|
|
8306
|
+
schema: z.number().int().gte(0).describe("Show only the first n items").optional()
|
|
8307
|
+
},
|
|
8308
|
+
{
|
|
8309
|
+
name: "$skip",
|
|
8310
|
+
type: "Query",
|
|
8311
|
+
schema: z.number().int().gte(0).describe("Skip the first n items").optional()
|
|
8312
|
+
},
|
|
8313
|
+
{
|
|
8314
|
+
name: "$search",
|
|
8315
|
+
type: "Query",
|
|
8316
|
+
schema: z.string().describe("Search items by search phrases").optional()
|
|
8317
|
+
},
|
|
8318
|
+
{
|
|
8319
|
+
name: "$filter",
|
|
8320
|
+
type: "Query",
|
|
8321
|
+
schema: z.string().describe("Filter items by property values").optional()
|
|
8322
|
+
},
|
|
8323
|
+
{
|
|
8324
|
+
name: "$count",
|
|
8325
|
+
type: "Query",
|
|
8326
|
+
schema: z.boolean().describe("Include count of items").optional()
|
|
8327
|
+
},
|
|
8328
|
+
{
|
|
8329
|
+
name: "$orderby",
|
|
8330
|
+
type: "Query",
|
|
8331
|
+
schema: z.array(z.string()).describe("Order items by property values").optional()
|
|
8332
|
+
},
|
|
8333
|
+
{
|
|
8334
|
+
name: "$select",
|
|
8335
|
+
type: "Query",
|
|
8336
|
+
schema: z.array(z.string()).describe("Select properties to be returned").optional()
|
|
8337
|
+
},
|
|
8338
|
+
{
|
|
8339
|
+
name: "$expand",
|
|
8340
|
+
type: "Query",
|
|
8341
|
+
schema: z.array(z.string()).describe("Expand related entities").optional()
|
|
8342
|
+
}
|
|
8343
|
+
],
|
|
8344
|
+
response: z.void(),
|
|
8345
|
+
errors: [
|
|
8346
|
+
{
|
|
8347
|
+
status: NaN,
|
|
8348
|
+
description: `Retrieved collection`,
|
|
8349
|
+
schema: microsoft_graph_messageCollectionResponse
|
|
8350
|
+
},
|
|
8351
|
+
{
|
|
8352
|
+
status: NaN,
|
|
8353
|
+
description: `error`,
|
|
8354
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8355
|
+
},
|
|
8356
|
+
{
|
|
8357
|
+
status: NaN,
|
|
8358
|
+
description: `error`,
|
|
8359
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8360
|
+
}
|
|
8361
|
+
]
|
|
8362
|
+
},
|
|
8363
|
+
{
|
|
8364
|
+
method: "get",
|
|
8365
|
+
path: "/users/:userId/messages",
|
|
8366
|
+
alias: "list-shared-mailbox-messages",
|
|
8367
|
+
description: `The messages in a mailbox or folder. Read-only. Nullable.`,
|
|
8368
|
+
requestFormat: "json",
|
|
8369
|
+
parameters: [
|
|
8370
|
+
{
|
|
8371
|
+
name: "includeHiddenMessages",
|
|
8372
|
+
type: "Query",
|
|
8373
|
+
schema: z.string().describe("Include Hidden Messages").optional()
|
|
8374
|
+
},
|
|
8375
|
+
{
|
|
8376
|
+
name: "$top",
|
|
8377
|
+
type: "Query",
|
|
8378
|
+
schema: z.number().int().gte(0).describe("Show only the first n items").optional()
|
|
8379
|
+
},
|
|
8380
|
+
{
|
|
8381
|
+
name: "$skip",
|
|
8382
|
+
type: "Query",
|
|
8383
|
+
schema: z.number().int().gte(0).describe("Skip the first n items").optional()
|
|
8384
|
+
},
|
|
8385
|
+
{
|
|
8386
|
+
name: "$search",
|
|
8387
|
+
type: "Query",
|
|
8388
|
+
schema: z.string().describe("Search items by search phrases").optional()
|
|
8389
|
+
},
|
|
8390
|
+
{
|
|
8391
|
+
name: "$filter",
|
|
8392
|
+
type: "Query",
|
|
8393
|
+
schema: z.string().describe("Filter items by property values").optional()
|
|
8394
|
+
},
|
|
8395
|
+
{
|
|
8396
|
+
name: "$count",
|
|
8397
|
+
type: "Query",
|
|
8398
|
+
schema: z.boolean().describe("Include count of items").optional()
|
|
8399
|
+
},
|
|
8400
|
+
{
|
|
8401
|
+
name: "$orderby",
|
|
8402
|
+
type: "Query",
|
|
8403
|
+
schema: z.array(z.string()).describe("Order items by property values").optional()
|
|
8404
|
+
},
|
|
8405
|
+
{
|
|
8406
|
+
name: "$select",
|
|
8407
|
+
type: "Query",
|
|
8408
|
+
schema: z.array(z.string()).describe("Select properties to be returned").optional()
|
|
8409
|
+
},
|
|
8410
|
+
{
|
|
8411
|
+
name: "$expand",
|
|
8412
|
+
type: "Query",
|
|
8413
|
+
schema: z.array(z.string()).describe("Expand related entities").optional()
|
|
8414
|
+
}
|
|
8415
|
+
],
|
|
8416
|
+
response: z.void(),
|
|
8417
|
+
errors: [
|
|
8418
|
+
{
|
|
8419
|
+
status: NaN,
|
|
8420
|
+
description: `Retrieved collection`,
|
|
8421
|
+
schema: microsoft_graph_messageCollectionResponse
|
|
8422
|
+
},
|
|
8423
|
+
{
|
|
8424
|
+
status: NaN,
|
|
8425
|
+
description: `error`,
|
|
8426
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8427
|
+
},
|
|
8428
|
+
{
|
|
8429
|
+
status: NaN,
|
|
8430
|
+
description: `error`,
|
|
8431
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8432
|
+
}
|
|
8433
|
+
]
|
|
8434
|
+
},
|
|
8435
|
+
{
|
|
8436
|
+
method: "get",
|
|
8437
|
+
path: "/users/:userId/messages/:messageId",
|
|
8438
|
+
alias: "get-shared-mailbox-message",
|
|
8439
|
+
description: `The messages in a mailbox or folder. Read-only. Nullable.`,
|
|
8440
|
+
requestFormat: "json",
|
|
8441
|
+
parameters: [
|
|
8442
|
+
{
|
|
8443
|
+
name: "includeHiddenMessages",
|
|
8444
|
+
type: "Query",
|
|
8445
|
+
schema: z.string().describe("Include Hidden Messages").optional()
|
|
8446
|
+
},
|
|
8447
|
+
{
|
|
8448
|
+
name: "$select",
|
|
8449
|
+
type: "Query",
|
|
8450
|
+
schema: z.array(z.string()).describe("Select properties to be returned").optional()
|
|
8451
|
+
},
|
|
8452
|
+
{
|
|
8453
|
+
name: "$expand",
|
|
8454
|
+
type: "Query",
|
|
8455
|
+
schema: z.array(z.string()).describe("Expand related entities").optional()
|
|
8456
|
+
}
|
|
8457
|
+
],
|
|
8458
|
+
response: z.void(),
|
|
8459
|
+
errors: [
|
|
8460
|
+
{
|
|
8461
|
+
status: NaN,
|
|
8462
|
+
description: `Retrieved navigation property`,
|
|
8463
|
+
schema: z.object({
|
|
8464
|
+
body: microsoft_graph_itemBody.optional(),
|
|
8465
|
+
subject: z.string().describe("The subject of the message.").nullish(),
|
|
8466
|
+
bccRecipients: z.array(microsoft_graph_recipient).describe("The Bcc: recipients for the message.").optional(),
|
|
8467
|
+
bodyPreview: z.string().describe("The first 255 characters of the message body. It is in text format.").nullish(),
|
|
8468
|
+
ccRecipients: z.array(microsoft_graph_recipient).describe("The Cc: recipients for the message.").optional(),
|
|
8469
|
+
conversationId: z.string().describe("The ID of the conversation the email belongs to.").nullish(),
|
|
8470
|
+
conversationIndex: z.string().describe("Indicates the position of the message within the conversation.").nullish(),
|
|
8471
|
+
flag: microsoft_graph_followupFlag.optional(),
|
|
8472
|
+
from: microsoft_graph_recipient.optional(),
|
|
8473
|
+
hasAttachments: z.boolean().describe(
|
|
8474
|
+
"Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as <IMG src='cid:image001.jpg@01D26CD8.6C05F070'>."
|
|
8475
|
+
).nullish(),
|
|
8476
|
+
importance: microsoft_graph_importance.optional(),
|
|
8477
|
+
inferenceClassification: microsoft_graph_inferenceClassificationType.optional(),
|
|
8478
|
+
internetMessageHeaders: z.array(microsoft_graph_internetMessageHeader).describe(
|
|
8479
|
+
"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."
|
|
8480
|
+
).optional(),
|
|
8481
|
+
internetMessageId: z.string().describe("The message ID in the format specified by RFC2822.").nullish(),
|
|
8482
|
+
isDeliveryReceiptRequested: z.boolean().describe("Indicates whether a read receipt is requested for the message.").nullish(),
|
|
8483
|
+
isDraft: z.boolean().describe(
|
|
8484
|
+
"Indicates whether the message is a draft. A message is a draft if it hasn't been sent yet."
|
|
8485
|
+
).nullish(),
|
|
8486
|
+
isRead: z.boolean().describe("Indicates whether the message has been read.").nullish(),
|
|
8487
|
+
isReadReceiptRequested: z.boolean().describe("Indicates whether a read receipt is requested for the message.").nullish(),
|
|
8488
|
+
parentFolderId: z.string().describe("The unique identifier for the message's parent mailFolder.").nullish(),
|
|
8489
|
+
receivedDateTime: z.string().regex(
|
|
8490
|
+
/^[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])$/
|
|
8491
|
+
).datetime({ offset: true }).describe(
|
|
8492
|
+
"The date and time the message was received. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z."
|
|
8493
|
+
).nullish(),
|
|
8494
|
+
replyTo: z.array(microsoft_graph_recipient).describe("The email addresses to use when replying.").optional(),
|
|
8495
|
+
sender: microsoft_graph_recipient.optional(),
|
|
8496
|
+
sentDateTime: z.string().regex(
|
|
8497
|
+
/^[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])$/
|
|
8498
|
+
).datetime({ offset: true }).describe(
|
|
8499
|
+
"The date and time the message was sent. The date and time information uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z."
|
|
8500
|
+
).nullish(),
|
|
8501
|
+
toRecipients: z.array(microsoft_graph_recipient).describe("The To: recipients for the message.").optional(),
|
|
8502
|
+
uniqueBody: microsoft_graph_itemBody.optional()
|
|
8503
|
+
}).strict().passthrough()
|
|
8504
|
+
},
|
|
8505
|
+
{
|
|
8506
|
+
status: NaN,
|
|
8507
|
+
description: `error`,
|
|
8508
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8509
|
+
},
|
|
8510
|
+
{
|
|
8511
|
+
status: NaN,
|
|
8512
|
+
description: `error`,
|
|
8513
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8514
|
+
}
|
|
8515
|
+
]
|
|
8516
|
+
},
|
|
8517
|
+
{
|
|
8518
|
+
method: "post",
|
|
8519
|
+
path: "/users/:userId/sendMail",
|
|
8520
|
+
alias: "send-shared-mailbox-mail",
|
|
8521
|
+
description: `Send the message specified in the request body using either JSON or MIME format. When using JSON format, you can include a file attachment in the same sendMail action call. When using MIME format: This method saves the message in the Sent Items folder. Alternatively, create a draft message to send later. To learn more about the steps involved in the backend before a mail is delivered to recipients, see here.`,
|
|
8522
|
+
requestFormat: "json",
|
|
8523
|
+
parameters: [
|
|
8524
|
+
{
|
|
8525
|
+
name: "body",
|
|
8526
|
+
description: `Action parameters`,
|
|
8527
|
+
type: "Body",
|
|
8528
|
+
schema: send_mail_Body
|
|
8529
|
+
}
|
|
8530
|
+
],
|
|
8531
|
+
response: z.void(),
|
|
8532
|
+
errors: [
|
|
8533
|
+
{
|
|
8534
|
+
status: NaN,
|
|
8535
|
+
description: `error`,
|
|
8536
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8537
|
+
},
|
|
8538
|
+
{
|
|
8539
|
+
status: NaN,
|
|
8540
|
+
description: `error`,
|
|
8541
|
+
schema: microsoft_graph_ODataErrors_ODataError
|
|
8542
|
+
}
|
|
8543
|
+
]
|
|
7995
8544
|
}
|
|
7996
8545
|
]);
|
|
7997
8546
|
const api = new Zodios(endpoints);
|
package/dist/graph-tools.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
-
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.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",
|
package/src/endpoints.json
CHANGED
|
@@ -29,6 +29,36 @@
|
|
|
29
29
|
"toolName": "send-mail",
|
|
30
30
|
"scopes": ["Mail.Send"]
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"pathPattern": "/users/{user-id}/messages",
|
|
34
|
+
"method": "get",
|
|
35
|
+
"toolName": "list-shared-mailbox-messages",
|
|
36
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"pathPattern": "/users/{user-id}/mailFolders/{mailFolder-id}/messages",
|
|
40
|
+
"method": "get",
|
|
41
|
+
"toolName": "list-shared-mailbox-folder-messages",
|
|
42
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"pathPattern": "/users/{user-id}/messages/{message-id}",
|
|
46
|
+
"method": "get",
|
|
47
|
+
"toolName": "get-shared-mailbox-message",
|
|
48
|
+
"workScopes": ["Mail.Read.Shared"]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"pathPattern": "/users/{user-id}/sendMail",
|
|
52
|
+
"method": "post",
|
|
53
|
+
"toolName": "send-shared-mailbox-mail",
|
|
54
|
+
"workScopes": ["Mail.Send.Shared"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"pathPattern": "/users",
|
|
58
|
+
"method": "get",
|
|
59
|
+
"toolName": "list-users",
|
|
60
|
+
"workScopes": ["User.Read.All"]
|
|
61
|
+
},
|
|
32
62
|
{
|
|
33
63
|
"pathPattern": "/me/messages",
|
|
34
64
|
"method": "post",
|