@softeria/ms-365-mcp-server 0.154.3 → 0.155.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 +14 -0
- package/dist/endpoints.json +33 -0
- package/dist/generated/client-beta.js +101 -1
- package/dist/graph-tools.js +1 -1
- package/dist/lib/param-descriptions.js +3 -2
- package/dist/lib/query-parameter-schema.js +8 -1
- package/dist/lib/tool-schema.js +1 -1
- package/package.json +1 -1
- package/src/endpoints.json +33 -0
package/README.md
CHANGED
|
@@ -105,6 +105,20 @@ Email (Outlook), Calendar, OneDrive Files, Excel, OneNote, To Do Tasks, Planner,
|
|
|
105
105
|
|
|
106
106
|
Teams & Chats, Online Meetings, Transcripts & Recordings, Attendance Reports, SharePoint Sites & Lists, Shared Mailboxes & Calendars, User Management, Presence, Virtual Events
|
|
107
107
|
|
|
108
|
+
Custom Teams emojis are available in organization mode through `list-custom-emojis`
|
|
109
|
+
and `create-custom-emoji` (`teams` and `work` presets). These use the Microsoft Graph
|
|
110
|
+
beta API and request the delegated permissions `TeamworkCustomEmoji.Read` and
|
|
111
|
+
`TeamworkCustomEmoji.Create`, respectively. Read-only mode exposes only the list tool.
|
|
112
|
+
Existing deployments may need consent for these new scopes and reauthentication;
|
|
113
|
+
adding tool support does not upgrade an already-issued token.
|
|
114
|
+
|
|
115
|
+
Listing returns base64 image content, so use a small `top` and `filter` to keep
|
|
116
|
+
responses manageable. To create an emoji, pass `body: { displayName, contentBytes }`
|
|
117
|
+
with the exact approved name and base64 PNG/GIF file bytes. See Microsoft's
|
|
118
|
+
[list](https://learn.microsoft.com/en-us/graph/api/teamworkmessaging-list-customemojis?view=graph-rest-beta)
|
|
119
|
+
and [create](https://learn.microsoft.com/en-us/graph/api/teamworkmessaging-post-customemojis?view=graph-rest-beta)
|
|
120
|
+
contracts. These tools do not post messages or reactions.
|
|
121
|
+
|
|
108
122
|
### Required Graph API Permissions
|
|
109
123
|
|
|
110
124
|
Permissions are requested dynamically based on which tools are enabled. Use `--list-permissions` to see the exact permissions for your configuration:
|
package/dist/endpoints.json
CHANGED
|
@@ -1659,6 +1659,39 @@
|
|
|
1659
1659
|
"presets": ["teams", "teams-write", "work"],
|
|
1660
1660
|
"workScopes": ["Team.ReadBasic.All"]
|
|
1661
1661
|
},
|
|
1662
|
+
{
|
|
1663
|
+
"pathPattern": "/teamwork/messaging/customEmojis",
|
|
1664
|
+
"method": "get",
|
|
1665
|
+
"toolName": "list-custom-emojis",
|
|
1666
|
+
"apiVersion": "beta",
|
|
1667
|
+
"presets": ["teams", "work"],
|
|
1668
|
+
"workScopes": ["TeamworkCustomEmoji.Read"],
|
|
1669
|
+
"llmTip": "Lists the organization's custom Teams emojis, including displayName, contentBytes (base64 PNG/GIF), createdBy and createdDateTime. The documented query options are $top and $filter. Image bytes can make responses large: start with a small $top and narrow with $filter; use fetchAllPages only for an explicitly requested export. displayName is the unique key, not an id. Work/school accounts only. Microsoft Graph beta API: subject to change."
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
"pathPattern": "/teamwork/messaging/customEmojis",
|
|
1673
|
+
"method": "post",
|
|
1674
|
+
"toolName": "create-custom-emoji",
|
|
1675
|
+
"apiVersion": "beta",
|
|
1676
|
+
"presets": ["teams", "work"],
|
|
1677
|
+
"workScopes": ["TeamworkCustomEmoji.Create"],
|
|
1678
|
+
"requestBodySchema": {
|
|
1679
|
+
"type": "object",
|
|
1680
|
+
"required": ["displayName", "contentBytes"],
|
|
1681
|
+
"properties": {
|
|
1682
|
+
"displayName": {
|
|
1683
|
+
"type": "string",
|
|
1684
|
+
"description": "Exact unique custom emoji name, without surrounding colons. Must not conflict with an existing emoji name."
|
|
1685
|
+
},
|
|
1686
|
+
"contentBytes": {
|
|
1687
|
+
"type": "string",
|
|
1688
|
+
"description": "Base64-encoded PNG or GIF file content; do not include a data-URL prefix."
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
"additionalProperties": false
|
|
1692
|
+
},
|
|
1693
|
+
"llmTip": "Uploads a custom Teams emoji for the organization using body: { displayName, contentBytes }. Only PNG and GIF are supported; pass the complete image file as base64. Confirm the exact name and image with the user before creating it. Returns the created emoji, including its image bytes; use excludeResponse=true when only success/failure is needed. Work/school accounts only. Microsoft Graph beta API: subject to change."
|
|
1694
|
+
},
|
|
1662
1695
|
{
|
|
1663
1696
|
"pathPattern": "/teams/{team-id}",
|
|
1664
1697
|
"method": "get",
|
|
@@ -742,6 +742,36 @@ const microsoft_graph_plannerTaskChatMessageCollectionResponse = z.object({
|
|
|
742
742
|
"@odata.nextLink": z.string().nullable(),
|
|
743
743
|
value: z.array(microsoft_graph_plannerTaskChatMessage)
|
|
744
744
|
}).partial().passthrough();
|
|
745
|
+
const microsoft_graph_customEmojiFromIdentitySet = z.object({
|
|
746
|
+
application: microsoft_graph_identity.optional(),
|
|
747
|
+
device: microsoft_graph_identity.optional(),
|
|
748
|
+
user: microsoft_graph_identity.optional()
|
|
749
|
+
}).passthrough();
|
|
750
|
+
const microsoft_graph_teamworkCustomEmoji = z.object({
|
|
751
|
+
contentBytes: z.string().describe(
|
|
752
|
+
"The base64-encoded image content of the emoji. Supported formats include PNG and GIF."
|
|
753
|
+
).nullish(),
|
|
754
|
+
createdBy: microsoft_graph_customEmojiFromIdentitySet.optional(),
|
|
755
|
+
createdDateTime: z.string().regex(
|
|
756
|
+
/^[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])$/
|
|
757
|
+
).datetime({ offset: true }).describe(
|
|
758
|
+
"The date and time when the emoji was created. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2024, is 2024-01-01T00:00:00Z."
|
|
759
|
+
).optional(),
|
|
760
|
+
displayName: z.string().describe(
|
|
761
|
+
"The unique display name of the custom emoji. Key. Must be unique and must not conflict with existing emoji names."
|
|
762
|
+
).optional()
|
|
763
|
+
}).passthrough();
|
|
764
|
+
const microsoft_graph_teamworkCustomEmojiCollectionResponse = z.object({
|
|
765
|
+
"@odata.count": z.number().int().nullable(),
|
|
766
|
+
"@odata.nextLink": z.string().nullable(),
|
|
767
|
+
value: z.array(microsoft_graph_teamworkCustomEmoji)
|
|
768
|
+
}).partial().passthrough();
|
|
769
|
+
const create_custom_emoji_Body = z.object({
|
|
770
|
+
displayName: z.string().describe(
|
|
771
|
+
"Exact unique custom emoji name, without surrounding colons. Must not conflict with an existing emoji name."
|
|
772
|
+
),
|
|
773
|
+
contentBytes: z.string().describe("Base64-encoded PNG or GIF file content; do not include a data-URL prefix.")
|
|
774
|
+
}).passthrough();
|
|
745
775
|
const schemas = {
|
|
746
776
|
microsoft_graph_allowedAudiences,
|
|
747
777
|
microsoft_graph_identity,
|
|
@@ -800,7 +830,11 @@ const schemas = {
|
|
|
800
830
|
microsoft_graph_plannerTaskChatReactionEvent,
|
|
801
831
|
microsoft_graph_plannerTaskChatReaction,
|
|
802
832
|
microsoft_graph_plannerTaskChatMessage,
|
|
803
|
-
microsoft_graph_plannerTaskChatMessageCollectionResponse
|
|
833
|
+
microsoft_graph_plannerTaskChatMessageCollectionResponse,
|
|
834
|
+
microsoft_graph_customEmojiFromIdentitySet,
|
|
835
|
+
microsoft_graph_teamworkCustomEmoji,
|
|
836
|
+
microsoft_graph_teamworkCustomEmojiCollectionResponse,
|
|
837
|
+
create_custom_emoji_Body
|
|
804
838
|
};
|
|
805
839
|
const endpoints = makeApi([
|
|
806
840
|
{
|
|
@@ -903,6 +937,72 @@ const endpoints = makeApi([
|
|
|
903
937
|
}
|
|
904
938
|
],
|
|
905
939
|
response: z.void()
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
method: "get",
|
|
943
|
+
path: "/teamwork/messaging/customEmojis",
|
|
944
|
+
alias: "list-custom-emojis",
|
|
945
|
+
description: `Get a list of custom emojis available in the teamwork messaging of the organization.`,
|
|
946
|
+
requestFormat: "json",
|
|
947
|
+
parameters: [
|
|
948
|
+
{
|
|
949
|
+
name: "$top",
|
|
950
|
+
type: "Query",
|
|
951
|
+
schema: z.number().int().gte(0).describe("Show only the first n items").optional()
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
name: "$skip",
|
|
955
|
+
type: "Query",
|
|
956
|
+
schema: z.number().int().gte(0).describe("Skip the first n items").optional()
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: "$search",
|
|
960
|
+
type: "Query",
|
|
961
|
+
schema: z.string().describe("Search items by search phrases").optional()
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
name: "$filter",
|
|
965
|
+
type: "Query",
|
|
966
|
+
schema: z.string().describe("Filter items by property values").optional()
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
name: "$count",
|
|
970
|
+
type: "Query",
|
|
971
|
+
schema: z.boolean().describe("Include count of items").optional()
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
name: "$orderby",
|
|
975
|
+
type: "Query",
|
|
976
|
+
schema: z.array(z.string()).describe("Order items by property values").optional()
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: "$select",
|
|
980
|
+
type: "Query",
|
|
981
|
+
schema: z.array(z.string()).describe("Select properties to be returned").optional()
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
name: "$expand",
|
|
985
|
+
type: "Query",
|
|
986
|
+
schema: z.array(z.string()).describe("Expand related entities").optional()
|
|
987
|
+
}
|
|
988
|
+
],
|
|
989
|
+
response: microsoft_graph_teamworkCustomEmojiCollectionResponse
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
method: "post",
|
|
993
|
+
path: "/teamwork/messaging/customEmojis",
|
|
994
|
+
alias: "create-custom-emoji",
|
|
995
|
+
description: `Create a new custom emoji in the teamwork messaging of the organization, which adds the custom emoji to Teams for the tenant. The emoji image is provided as base64-encoded content bytes.`,
|
|
996
|
+
requestFormat: "json",
|
|
997
|
+
parameters: [
|
|
998
|
+
{
|
|
999
|
+
name: "body",
|
|
1000
|
+
description: `New navigation property`,
|
|
1001
|
+
type: "Body",
|
|
1002
|
+
schema: create_custom_emoji_Body
|
|
1003
|
+
}
|
|
1004
|
+
],
|
|
1005
|
+
response: microsoft_graph_teamworkCustomEmoji
|
|
906
1006
|
}
|
|
907
1007
|
]);
|
|
908
1008
|
const api = new Zodios(endpoints);
|
package/dist/graph-tools.js
CHANGED
|
@@ -1671,7 +1671,7 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
|
|
|
1671
1671
|
}
|
|
1672
1672
|
if (isFetchAllPagesApplicable(tool)) {
|
|
1673
1673
|
const maxPages = getMaxPages();
|
|
1674
|
-
paramSchema["fetchAllPages"] = z.boolean().describe(getFetchAllPagesParamDescription(maxPages)).optional();
|
|
1674
|
+
paramSchema["fetchAllPages"] = z.boolean().describe(getFetchAllPagesParamDescription(maxPages, tool.alias)).optional();
|
|
1675
1675
|
}
|
|
1676
1676
|
if (isSkiptokenApplicable(tool, Object.keys(paramSchema))) {
|
|
1677
1677
|
paramSchema["skiptoken"] = z.string().describe(SKIPTOKEN_PARAM_DESCRIPTION).optional();
|
|
@@ -55,8 +55,9 @@ function getAccountParamDescription(accountNames) {
|
|
|
55
55
|
const accountHint = accountNames.length > 0 ? `Known accounts: ${accountNames.join(", ")}. ` : "";
|
|
56
56
|
return `${accountHint}Microsoft account email to use for this request. Required when multiple accounts are configured. Use the list-accounts tool to discover all currently available accounts.`;
|
|
57
57
|
}
|
|
58
|
-
function getFetchAllPagesParamDescription(maxPages) {
|
|
59
|
-
|
|
58
|
+
function getFetchAllPagesParamDescription(maxPages, toolAlias) {
|
|
59
|
+
const narrowingOptions = toolAlias === "list-custom-emojis" ? "$filter" : "$filter/$search";
|
|
60
|
+
return `Follow @odata.nextLink and merge up to ${maxPages} pages into one response. Can return enormous payloads\u2014only when the user explicitly needs a full export. Prefer a small $top first, then paginate or narrow with ${narrowingOptions}.`;
|
|
60
61
|
}
|
|
61
62
|
function getODataParamDescription(bareName) {
|
|
62
63
|
switch (bareName) {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getODataParamDescription, shouldOmitTopParam } from "./param-descriptions.js";
|
|
3
3
|
const TEAM_LIST_TOOLS = /* @__PURE__ */ new Set(["list-joined-teams", "list-my-associated-teams"]);
|
|
4
|
+
const CUSTOM_EMOJI_QUERY_DESCRIPTIONS = {
|
|
5
|
+
top: "Number of custom emojis to return in one page. Each emoji includes base64 image content; use a small page size to keep the response manageable.",
|
|
6
|
+
filter: "OData filter expression for custom emojis, forwarded to Microsoft Graph. Filter support is determined by the beta API."
|
|
7
|
+
};
|
|
4
8
|
function queryParameterSchema(toolName, name, providerSchema) {
|
|
5
9
|
const bareName = name.replace(/^\$/, "").toLowerCase();
|
|
6
10
|
if (TEAM_LIST_TOOLS.has(toolName)) return void 0;
|
|
11
|
+
if (toolName === "list-custom-emojis" && !["top", "filter", "skiptoken"].includes(bareName)) {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
7
14
|
if (bareName === "top" && shouldOmitTopParam(toolName)) return void 0;
|
|
8
15
|
const source = providerSchema instanceof z.ZodOptional ? providerSchema.unwrap() : providerSchema;
|
|
9
16
|
let schema = source;
|
|
@@ -25,7 +32,7 @@ function queryParameterSchema(toolName, name, providerSchema) {
|
|
|
25
32
|
break;
|
|
26
33
|
}
|
|
27
34
|
if (providerSchema.isOptional()) schema = schema.optional();
|
|
28
|
-
const description = getODataParamDescription(bareName);
|
|
35
|
+
const description = toolName === "list-custom-emojis" && CUSTOM_EMOJI_QUERY_DESCRIPTIONS[bareName] || getODataParamDescription(bareName);
|
|
29
36
|
return description ? schema.describe(description) : schema;
|
|
30
37
|
}
|
|
31
38
|
export {
|
package/dist/lib/tool-schema.js
CHANGED
|
@@ -53,7 +53,7 @@ function describeToolSchema(tool, config, ctx = {}) {
|
|
|
53
53
|
name: "fetchAllPages",
|
|
54
54
|
in: "Query",
|
|
55
55
|
required: false,
|
|
56
|
-
description: getFetchAllPagesParamDescription(getMaxPages()),
|
|
56
|
+
description: getFetchAllPagesParamDescription(getMaxPages(), tool.alias),
|
|
57
57
|
schema: { type: "boolean" }
|
|
58
58
|
});
|
|
59
59
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
3
|
"mcpName": "io.github.Softeria/ms-365-mcp-server",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.155.0",
|
|
5
5
|
"description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
package/src/endpoints.json
CHANGED
|
@@ -1659,6 +1659,39 @@
|
|
|
1659
1659
|
"presets": ["teams", "teams-write", "work"],
|
|
1660
1660
|
"workScopes": ["Team.ReadBasic.All"]
|
|
1661
1661
|
},
|
|
1662
|
+
{
|
|
1663
|
+
"pathPattern": "/teamwork/messaging/customEmojis",
|
|
1664
|
+
"method": "get",
|
|
1665
|
+
"toolName": "list-custom-emojis",
|
|
1666
|
+
"apiVersion": "beta",
|
|
1667
|
+
"presets": ["teams", "work"],
|
|
1668
|
+
"workScopes": ["TeamworkCustomEmoji.Read"],
|
|
1669
|
+
"llmTip": "Lists the organization's custom Teams emojis, including displayName, contentBytes (base64 PNG/GIF), createdBy and createdDateTime. The documented query options are $top and $filter. Image bytes can make responses large: start with a small $top and narrow with $filter; use fetchAllPages only for an explicitly requested export. displayName is the unique key, not an id. Work/school accounts only. Microsoft Graph beta API: subject to change."
|
|
1670
|
+
},
|
|
1671
|
+
{
|
|
1672
|
+
"pathPattern": "/teamwork/messaging/customEmojis",
|
|
1673
|
+
"method": "post",
|
|
1674
|
+
"toolName": "create-custom-emoji",
|
|
1675
|
+
"apiVersion": "beta",
|
|
1676
|
+
"presets": ["teams", "work"],
|
|
1677
|
+
"workScopes": ["TeamworkCustomEmoji.Create"],
|
|
1678
|
+
"requestBodySchema": {
|
|
1679
|
+
"type": "object",
|
|
1680
|
+
"required": ["displayName", "contentBytes"],
|
|
1681
|
+
"properties": {
|
|
1682
|
+
"displayName": {
|
|
1683
|
+
"type": "string",
|
|
1684
|
+
"description": "Exact unique custom emoji name, without surrounding colons. Must not conflict with an existing emoji name."
|
|
1685
|
+
},
|
|
1686
|
+
"contentBytes": {
|
|
1687
|
+
"type": "string",
|
|
1688
|
+
"description": "Base64-encoded PNG or GIF file content; do not include a data-URL prefix."
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
"additionalProperties": false
|
|
1692
|
+
},
|
|
1693
|
+
"llmTip": "Uploads a custom Teams emoji for the organization using body: { displayName, contentBytes }. Only PNG and GIF are supported; pass the complete image file as base64. Confirm the exact name and image with the user before creating it. Returns the created emoji, including its image bytes; use excludeResponse=true when only success/failure is needed. Work/school accounts only. Microsoft Graph beta API: subject to change."
|
|
1694
|
+
},
|
|
1662
1695
|
{
|
|
1663
1696
|
"pathPattern": "/teams/{team-id}",
|
|
1664
1697
|
"method": "get",
|