@todoist/comms-mcp 0.0.1 → 11.0.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.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +198 -34
  3. package/dist/comms-tool.d.ts +14 -0
  4. package/dist/comms-tool.js +1 -0
  5. package/dist/index.d.ts +1324 -0
  6. package/dist/index.js +55 -0
  7. package/dist/main.d.ts +2 -0
  8. package/dist/main.js +24 -0
  9. package/dist/mcp-helpers.d.ts +17 -0
  10. package/dist/mcp-helpers.js +40 -0
  11. package/dist/mcp-server.d.ts +10 -0
  12. package/dist/mcp-server.js +78 -0
  13. package/dist/tool-registry.d.ts +3 -0
  14. package/dist/tool-registry.js +49 -0
  15. package/dist/tools/build-link.d.ts +63 -0
  16. package/dist/tools/build-link.js +93 -0
  17. package/dist/tools/channel-output.d.ts +19 -0
  18. package/dist/tools/channel-output.js +47 -0
  19. package/dist/tools/create-channel.d.ts +55 -0
  20. package/dist/tools/create-channel.js +44 -0
  21. package/dist/tools/create-conversation.d.ts +49 -0
  22. package/dist/tools/create-conversation.js +75 -0
  23. package/dist/tools/create-thread.d.ts +67 -0
  24. package/dist/tools/create-thread.js +126 -0
  25. package/dist/tools/delete-object.d.ts +44 -0
  26. package/dist/tools/delete-object.js +84 -0
  27. package/dist/tools/fetch-inbox.d.ts +91 -0
  28. package/dist/tools/fetch-inbox.js +227 -0
  29. package/dist/tools/get-groups.d.ts +62 -0
  30. package/dist/tools/get-groups.js +116 -0
  31. package/dist/tools/get-mentions.d.ts +97 -0
  32. package/dist/tools/get-mentions.js +126 -0
  33. package/dist/tools/get-users.d.ts +58 -0
  34. package/dist/tools/get-users.js +107 -0
  35. package/dist/tools/get-workspaces.d.ts +61 -0
  36. package/dist/tools/get-workspaces.js +120 -0
  37. package/dist/tools/list-channels.d.ts +47 -0
  38. package/dist/tools/list-channels.js +89 -0
  39. package/dist/tools/list-conversations.d.ts +66 -0
  40. package/dist/tools/list-conversations.js +212 -0
  41. package/dist/tools/load-conversation.d.ts +92 -0
  42. package/dist/tools/load-conversation.js +128 -0
  43. package/dist/tools/load-thread.d.ts +127 -0
  44. package/dist/tools/load-thread.js +175 -0
  45. package/dist/tools/mark-done.d.ts +111 -0
  46. package/dist/tools/mark-done.js +275 -0
  47. package/dist/tools/mark-read.d.ts +73 -0
  48. package/dist/tools/mark-read.js +214 -0
  49. package/dist/tools/react.d.ts +59 -0
  50. package/dist/tools/react.js +97 -0
  51. package/dist/tools/reply.d.ts +69 -0
  52. package/dist/tools/reply.js +122 -0
  53. package/dist/tools/search-content.d.ts +103 -0
  54. package/dist/tools/search-content.js +138 -0
  55. package/dist/tools/update-channel.d.ts +53 -0
  56. package/dist/tools/update-channel.js +45 -0
  57. package/dist/tools/update-object.d.ts +52 -0
  58. package/dist/tools/update-object.js +161 -0
  59. package/dist/tools/update-user-info.d.ts +55 -0
  60. package/dist/tools/update-user-info.js +270 -0
  61. package/dist/tools/user-info.d.ts +32 -0
  62. package/dist/tools/user-info.js +16 -0
  63. package/dist/tools/user-output.d.ts +9 -0
  64. package/dist/tools/user-output.js +28 -0
  65. package/dist/usage-tracking.d.ts +23 -0
  66. package/dist/usage-tracking.js +41 -0
  67. package/dist/utils/attachments.d.ts +24 -0
  68. package/dist/utils/attachments.js +57 -0
  69. package/dist/utils/concurrency.d.ts +20 -0
  70. package/dist/utils/concurrency.js +24 -0
  71. package/dist/utils/constants.d.ts +5 -0
  72. package/dist/utils/constants.js +5 -0
  73. package/dist/utils/degrade.d.ts +81 -0
  74. package/dist/utils/degrade.js +149 -0
  75. package/dist/utils/output-schemas.d.ts +1283 -0
  76. package/dist/utils/output-schemas.js +657 -0
  77. package/dist/utils/read-position.d.ts +21 -0
  78. package/dist/utils/read-position.js +37 -0
  79. package/dist/utils/search-results.d.ts +36 -0
  80. package/dist/utils/search-results.js +82 -0
  81. package/dist/utils/target-types.d.ts +114 -0
  82. package/dist/utils/target-types.js +58 -0
  83. package/dist/utils/test-helpers.d.ts +95 -0
  84. package/dist/utils/test-helpers.js +231 -0
  85. package/dist/utils/tool-names.d.ts +25 -0
  86. package/dist/utils/tool-names.js +25 -0
  87. package/dist/utils/url-helpers.d.ts +3 -0
  88. package/dist/utils/url-helpers.js +10 -0
  89. package/dist/utils/user-status.d.ts +8 -0
  90. package/dist/utils/user-status.js +33 -0
  91. package/dist/utils/validate-comms-token.d.ts +13 -0
  92. package/dist/utils/validate-comms-token.js +22 -0
  93. package/package.json +85 -8
@@ -0,0 +1,75 @@
1
+ import { getFullCommsURL } from '@doist/comms-sdk';
2
+ import { z } from 'zod';
3
+ import { CreateConversationOutputSchema, } from '../utils/output-schemas.js';
4
+ import { ToolNames } from '../utils/tool-names.js';
5
+ import { getConversationUrl } from '../utils/url-helpers.js';
6
+ const ArgsSchema = {
7
+ workspaceId: z.number().describe('The ID of the workspace the conversation belongs to.'),
8
+ recipients: z
9
+ .array(z.number())
10
+ .min(1)
11
+ .describe('User IDs to include in the direct or group conversation (excluding yourself, who is added automatically). Use get-users to resolve names to IDs.'),
12
+ content: z
13
+ .string()
14
+ .min(1)
15
+ .describe('The content of the first message to post. Markdown. Mention people with the link syntax [Name](comms-mention://USER_ID) — e.g. [Afzal](comms-mention://29367677) — never @Name or [[Name|id]], which post as literal text. Do not put "@" in the label; the client adds it. Groups use [Name](comms-group-mention://GROUP_ID), channels [#name](comms-channel://CHANNEL_ID), threads [Title](comms-thread://THREAD_ID). Resolve IDs with get-users/get-groups/list-channels first. Everyone in recipients is notified regardless of who is mentioned inline; a mentioned person who is not a participant is not notified.'),
16
+ };
17
+ const createConversation = {
18
+ name: ToolNames.CREATE_CONVERSATION,
19
+ description: 'Start a direct or group conversation with one or more users and post an initial message. Reuses the existing conversation if one already exists for the same set of users.',
20
+ parameters: ArgsSchema,
21
+ outputSchema: CreateConversationOutputSchema.shape,
22
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
23
+ async execute(args, client) {
24
+ const { workspaceId, recipients, content } = args;
25
+ // The backend dedupes on the participant set, so this returns the existing
26
+ // conversation for these users rather than creating a duplicate.
27
+ const conversation = await client.conversations.getOrCreateConversation({
28
+ workspaceId,
29
+ userIds: recipients,
30
+ });
31
+ const message = await client.conversationMessages.createMessage({
32
+ conversationId: conversation.id,
33
+ content,
34
+ });
35
+ const conversationUrl = conversation.url ?? getConversationUrl(conversation.workspaceId, conversation.id);
36
+ const messageUrl = message.url ??
37
+ getFullCommsURL({
38
+ workspaceId: message.workspaceId,
39
+ conversationId: message.conversationId,
40
+ messageId: message.id,
41
+ });
42
+ const created = message.posted.toISOString();
43
+ const lines = [
44
+ `# Conversation Started`,
45
+ '',
46
+ `**Conversation ID:** ${conversation.id}`,
47
+ `**Message ID:** ${message.id}`,
48
+ `**Participants:** ${conversation.userIds.join(', ')}`,
49
+ `**Created:** ${created}`,
50
+ `**URL:** ${conversationUrl}`,
51
+ '',
52
+ '## Message',
53
+ '',
54
+ content,
55
+ ];
56
+ const structuredContent = {
57
+ type: 'create_conversation_result',
58
+ success: true,
59
+ conversationId: conversation.id,
60
+ messageId: message.id,
61
+ workspaceId: conversation.workspaceId,
62
+ content,
63
+ recipients,
64
+ participants: conversation.userIds,
65
+ created,
66
+ conversationUrl,
67
+ messageUrl,
68
+ };
69
+ return {
70
+ textContent: lines.join('\n'),
71
+ structuredContent,
72
+ };
73
+ },
74
+ };
75
+ export { createConversation };
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ declare const createThread: {
3
+ name: "create-thread";
4
+ description: string;
5
+ parameters: {
6
+ channelId: z.ZodString;
7
+ title: z.ZodString;
8
+ content: z.ZodString;
9
+ recipients: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
10
+ displayInInbox: z.ZodOptional<z.ZodBoolean>;
11
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ notifyAudience: z.ZodOptional<z.ZodEnum<{
13
+ thread: "thread";
14
+ channel: "channel";
15
+ }>>;
16
+ };
17
+ outputSchema: {
18
+ type: z.ZodLiteral<"create_thread_result">;
19
+ success: z.ZodBoolean;
20
+ threadId: z.ZodString;
21
+ title: z.ZodString;
22
+ channelId: z.ZodString;
23
+ workspaceId: z.ZodNumber;
24
+ content: z.ZodString;
25
+ creator: z.ZodNumber;
26
+ created: z.ZodString;
27
+ threadUrl: z.ZodString;
28
+ recipients: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
29
+ groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
+ notifyAudience: z.ZodOptional<z.ZodEnum<{
31
+ thread: "thread";
32
+ channel: "channel";
33
+ }>>;
34
+ };
35
+ annotations: {
36
+ readOnlyHint: false;
37
+ destructiveHint: false;
38
+ idempotentHint: false;
39
+ };
40
+ execute(args: {
41
+ channelId: string;
42
+ title: string;
43
+ content: string;
44
+ recipients?: number[] | undefined;
45
+ displayInInbox?: boolean | undefined;
46
+ groups?: string[] | undefined;
47
+ notifyAudience?: "thread" | "channel" | undefined;
48
+ }, client: import("@doist/comms-sdk").CommsApi): Promise<{
49
+ textContent: string;
50
+ structuredContent: {
51
+ type: "create_thread_result";
52
+ success: boolean;
53
+ threadId: string;
54
+ title: string;
55
+ channelId: string;
56
+ workspaceId: number;
57
+ content: string;
58
+ creator: number;
59
+ created: string;
60
+ threadUrl: string;
61
+ recipients?: number[] | undefined;
62
+ groups?: string[] | undefined;
63
+ notifyAudience?: "thread" | "channel" | undefined;
64
+ };
65
+ }>;
66
+ };
67
+ export { createThread };
@@ -0,0 +1,126 @@
1
+ import { getFullCommsURL, NOTIFY_AUDIENCES } from '@doist/comms-sdk';
2
+ import { z } from 'zod';
3
+ import { CreateThreadOutputSchema } from '../utils/output-schemas.js';
4
+ import { ToolNames } from '../utils/tool-names.js';
5
+ const ArgsSchema = {
6
+ channelId: z.string().describe('The ID of the channel to create the thread in.'),
7
+ title: z.string().min(1).describe('The title of the thread.'),
8
+ content: z
9
+ .string()
10
+ .min(1)
11
+ .describe('The content/body of the thread. Markdown. Mention people with the link syntax [Name](comms-mention://USER_ID) — e.g. [Afzal](comms-mention://29367677) — never @Name or [[Name|id]], which post as literal text. Do not put "@" in the label; the client adds it. Groups use [Name](comms-group-mention://GROUP_ID), channels [#name](comms-channel://CHANNEL_ID), threads [Title](comms-thread://THREAD_ID). Resolve IDs with get-users/get-groups/list-channels first. Mentioning inline does not notify anyone — also pass mentioned user IDs in recipients and mentioned group IDs in groups.'),
12
+ recipients: z
13
+ .array(z.number())
14
+ .optional()
15
+ .describe("Optional array of individual user IDs to notify. To notify everyone in the channel, prefer notifyAudience: 'channel' instead of enumerating every member here. If omitted (with no groups and no notifyAudience), Comms applies the channel's defaults, which is everyone in the channel. Note: workspace users who have not joined this channel will not be notified — add their IDs explicitly if you want to reach them."),
16
+ displayInInbox: z
17
+ .boolean()
18
+ .optional()
19
+ .describe("If true, unarchives the thread after creation so it appears in the author's Inbox. Defaults to false. Can also be enabled for all calls by setting the COMMS_CREATE_THREAD_DISPLAY_IN_INBOX=true environment variable (local MCP only)."),
20
+ groups: z
21
+ .array(z.string())
22
+ .optional()
23
+ .describe('Optional array of group IDs to notify. Use get-groups to discover group IDs before passing them here.'),
24
+ notifyAudience: z
25
+ .enum(NOTIFY_AUDIENCES)
26
+ .optional()
27
+ .describe("Optional broader audience to notify in addition to recipients and groups. 'channel' tags the thread with \"Everyone in channel\" — use this to reach everyone instead of listing individual recipients. 'thread' (everyone who has interacted) has no effect when creating a thread, since a new thread has no interactions yet — use it on reply instead."),
28
+ };
29
+ const createThread = {
30
+ name: ToolNames.CREATE_THREAD,
31
+ description: 'Create a new thread in a workspace channel. Requires a channel ID, title, and content. Optionally notify specific users or groups.',
32
+ parameters: ArgsSchema,
33
+ outputSchema: CreateThreadOutputSchema.shape,
34
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
35
+ async execute(args, client) {
36
+ const { channelId, title, content, recipients, groups, notifyAudience, displayInInbox } = args;
37
+ const thread = await client.threads.createThread({
38
+ channelId,
39
+ title,
40
+ content,
41
+ recipients,
42
+ groups,
43
+ notifyAudience,
44
+ });
45
+ const wantsInboxDisplay = displayInInbox === true ||
46
+ (displayInInbox === undefined &&
47
+ process.env.COMMS_CREATE_THREAD_DISPLAY_IN_INBOX === 'true');
48
+ let displayedInInbox = false;
49
+ if (wantsInboxDisplay) {
50
+ // Unarchive so the thread appears in the author's Inbox.
51
+ // Failure here is non-fatal — the thread itself was created successfully.
52
+ try {
53
+ await client.inbox.unarchiveThread(thread.id);
54
+ displayedInInbox = true;
55
+ }
56
+ catch (error) {
57
+ console.error(`Error unarchiving thread ${thread.id} for Inbox display:`, {
58
+ threadId: thread.id,
59
+ error,
60
+ });
61
+ }
62
+ }
63
+ const postedValue = thread.posted;
64
+ const created = postedValue
65
+ ? typeof postedValue === 'string'
66
+ ? new Date(postedValue)
67
+ : postedValue
68
+ : new Date();
69
+ const threadUrl = thread.url ??
70
+ getFullCommsURL({
71
+ workspaceId: thread.workspaceId,
72
+ channelId: thread.channelId,
73
+ threadId: thread.id,
74
+ });
75
+ const inboxNote = displayedInInbox
76
+ ? '> Thread is in your Inbox (auto-unarchived after creation).'
77
+ : '> Note: Threads you create do not appear in your own Inbox by default — only recipients see them there. Find the thread in the channel view or via its URL.';
78
+ // Only 'channel' takes effect at thread creation. 'thread' (everyone who
79
+ // has interacted) is discarded by the backend — a new thread has no
80
+ // interactions yet — so it never becomes an applied audience here. Report
81
+ // the applied audience, not the request, so machine consumers aren't told
82
+ // an audience was notified when it wasn't.
83
+ const appliedAudience = notifyAudience === 'channel' ? notifyAudience : undefined;
84
+ const audienceNote = notifyAudience === 'channel'
85
+ ? 'Everyone in channel'
86
+ : notifyAudience === 'thread'
87
+ ? 'Everyone who has interacted (no effect at thread creation)'
88
+ : undefined;
89
+ const lines = [
90
+ `# Thread Created`,
91
+ '',
92
+ `**Title:** ${thread.title}`,
93
+ `**Thread ID:** ${thread.id}`,
94
+ `**Channel ID:** ${thread.channelId}`,
95
+ `**Created:** ${created.toISOString()}`,
96
+ `**URL:** ${threadUrl}`,
97
+ ...(audienceNote ? [`**Notified:** ${audienceNote}`] : []),
98
+ '',
99
+ '## Content',
100
+ '',
101
+ thread.content,
102
+ '',
103
+ inboxNote,
104
+ ];
105
+ const structuredContent = {
106
+ type: 'create_thread_result',
107
+ success: true,
108
+ threadId: thread.id,
109
+ title: thread.title,
110
+ channelId: thread.channelId,
111
+ workspaceId: thread.workspaceId,
112
+ content: thread.content,
113
+ creator: thread.creator,
114
+ created: created.toISOString(),
115
+ threadUrl,
116
+ ...(recipients ? { recipients } : {}),
117
+ ...(groups ? { groups } : {}),
118
+ ...(appliedAudience ? { notifyAudience: appliedAudience } : {}),
119
+ };
120
+ return {
121
+ textContent: lines.join('\n'),
122
+ structuredContent,
123
+ };
124
+ },
125
+ };
126
+ export { createThread };
@@ -0,0 +1,44 @@
1
+ import type { CommsApi } from '@doist/comms-sdk';
2
+ import { z } from 'zod';
3
+ import { type DeleteObjectStructured } from '../utils/output-schemas.js';
4
+ declare const deleteObject: {
5
+ name: "delete-object";
6
+ description: string;
7
+ parameters: {
8
+ targetType: z.ZodEnum<{
9
+ thread: "thread";
10
+ comment: "comment";
11
+ message: "message";
12
+ }>;
13
+ targetId: z.ZodString;
14
+ };
15
+ outputSchema: {
16
+ type: z.ZodEnum<{
17
+ delete_thread_result: "delete_thread_result";
18
+ delete_comment_result: "delete_comment_result";
19
+ delete_message_result: "delete_message_result";
20
+ }>;
21
+ success: z.ZodBoolean;
22
+ targetType: z.ZodEnum<{
23
+ thread: "thread";
24
+ comment: "comment";
25
+ message: "message";
26
+ }>;
27
+ threadId: z.ZodOptional<z.ZodString>;
28
+ commentId: z.ZodOptional<z.ZodString>;
29
+ messageId: z.ZodOptional<z.ZodString>;
30
+ };
31
+ annotations: {
32
+ readOnlyHint: false;
33
+ destructiveHint: true;
34
+ idempotentHint: true;
35
+ };
36
+ execute(args: {
37
+ targetType: "thread" | "comment" | "message";
38
+ targetId: string;
39
+ }, client: CommsApi): Promise<{
40
+ textContent: string;
41
+ structuredContent: DeleteObjectStructured;
42
+ }>;
43
+ };
44
+ export { deleteObject };
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ import { DeleteObjectOutputSchema, } from '../utils/output-schemas.js';
3
+ import { DeleteTargetTypeSchema } from '../utils/target-types.js';
4
+ import { ToolNames } from '../utils/tool-names.js';
5
+ const ArgsSchema = {
6
+ targetType: DeleteTargetTypeSchema.describe('The type of object to delete: thread, comment, or message.'),
7
+ targetId: z
8
+ .string()
9
+ .describe('The ID of the thread, comment, or conversation message to delete.'),
10
+ };
11
+ async function deleteThreadBranch(args, client) {
12
+ const { targetId } = args;
13
+ await client.threads.deleteThread(targetId);
14
+ const lines = [
15
+ `# Thread Deleted`,
16
+ '',
17
+ `**Thread ID:** ${targetId}`,
18
+ '',
19
+ 'The thread has been permanently deleted.',
20
+ ];
21
+ const structuredContent = {
22
+ type: 'delete_thread_result',
23
+ success: true,
24
+ targetType: 'thread',
25
+ threadId: targetId,
26
+ };
27
+ return { textContent: lines.join('\n'), structuredContent };
28
+ }
29
+ async function deleteCommentBranch(args, client) {
30
+ const { targetId } = args;
31
+ await client.comments.deleteComment(targetId);
32
+ const lines = [
33
+ `# Comment Deleted`,
34
+ '',
35
+ `**Comment ID:** ${targetId}`,
36
+ '',
37
+ 'The comment has been permanently deleted.',
38
+ ];
39
+ const structuredContent = {
40
+ type: 'delete_comment_result',
41
+ success: true,
42
+ targetType: 'comment',
43
+ commentId: targetId,
44
+ };
45
+ return { textContent: lines.join('\n'), structuredContent };
46
+ }
47
+ async function deleteMessageBranch(args, client) {
48
+ const { targetId } = args;
49
+ await client.conversationMessages.deleteMessage(targetId);
50
+ const lines = [
51
+ `# Message Deleted`,
52
+ '',
53
+ `**Message ID:** ${targetId}`,
54
+ '',
55
+ 'The conversation message has been permanently deleted.',
56
+ ];
57
+ const structuredContent = {
58
+ type: 'delete_message_result',
59
+ success: true,
60
+ targetType: 'message',
61
+ messageId: targetId,
62
+ };
63
+ return { textContent: lines.join('\n'), structuredContent };
64
+ }
65
+ const deleteObject = {
66
+ name: ToolNames.DELETE_OBJECT,
67
+ description: 'Permanently delete a Comms object. `targetType: "thread"` deletes a thread (and all of its comments); `"comment"` deletes a single thread comment; `"message"` deletes a direct/group conversation message. Always pass `targetId`. Deletion is irreversible — confirm with the user before invoking. Note: the Comms API only allows deletion by the object\'s creator or a workspace admin; the call will be rejected otherwise.',
68
+ parameters: ArgsSchema,
69
+ outputSchema: DeleteObjectOutputSchema.shape,
70
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
71
+ async execute(args, client) {
72
+ const { targetType } = args;
73
+ const branch = targetType === 'thread'
74
+ ? await deleteThreadBranch(args, client)
75
+ : targetType === 'comment'
76
+ ? await deleteCommentBranch(args, client)
77
+ : await deleteMessageBranch(args, client);
78
+ return {
79
+ textContent: branch.textContent,
80
+ structuredContent: branch.structuredContent,
81
+ };
82
+ },
83
+ };
84
+ export { deleteObject };
@@ -0,0 +1,91 @@
1
+ import type { InboxThread, UnreadConversation } from '@doist/comms-sdk';
2
+ import { z } from 'zod';
3
+ type FetchInboxStructured = {
4
+ type: 'inbox_data';
5
+ workspaceId: number;
6
+ threads: Array<{
7
+ id: string;
8
+ title: string;
9
+ channelId: string;
10
+ channelName?: string;
11
+ creator: number;
12
+ isUnread: boolean;
13
+ isArchived: boolean;
14
+ isStarred: boolean;
15
+ threadUrl: string;
16
+ }>;
17
+ conversations: Array<{
18
+ id: string;
19
+ title: string;
20
+ userIds: number[];
21
+ participantNames: string[];
22
+ isUnread: boolean;
23
+ conversationUrl: string;
24
+ }>;
25
+ unreadCount: number;
26
+ unreadThreads: InboxThread[];
27
+ unreadConversations: UnreadConversation[];
28
+ totalThreads: number;
29
+ totalConversations: number;
30
+ };
31
+ declare const fetchInbox: {
32
+ name: "fetch-inbox";
33
+ description: string;
34
+ parameters: {
35
+ workspaceId: z.ZodNumber;
36
+ sinceDate: z.ZodOptional<z.ZodString>;
37
+ untilDate: z.ZodOptional<z.ZodString>;
38
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
39
+ onlyUnread: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
+ archiveFilter: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
41
+ archived: "archived";
42
+ all: "all";
43
+ active: "active";
44
+ }>>>;
45
+ };
46
+ outputSchema: {
47
+ type: z.ZodLiteral<"inbox_data">;
48
+ workspaceId: z.ZodNumber;
49
+ threads: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ title: z.ZodString;
52
+ channelId: z.ZodString;
53
+ channelName: z.ZodOptional<z.ZodString>;
54
+ creator: z.ZodNumber;
55
+ isUnread: z.ZodBoolean;
56
+ isArchived: z.ZodBoolean;
57
+ isStarred: z.ZodBoolean;
58
+ threadUrl: z.ZodString;
59
+ }, z.core.$strip>>;
60
+ conversations: z.ZodArray<z.ZodObject<{
61
+ id: z.ZodString;
62
+ title: z.ZodString;
63
+ userIds: z.ZodArray<z.ZodNumber>;
64
+ participantNames: z.ZodArray<z.ZodString>;
65
+ isUnread: z.ZodBoolean;
66
+ conversationUrl: z.ZodString;
67
+ }, z.core.$strip>>;
68
+ unreadCount: z.ZodNumber;
69
+ unreadThreads: z.ZodArray<z.ZodAny>;
70
+ unreadConversations: z.ZodArray<z.ZodAny>;
71
+ totalThreads: z.ZodNumber;
72
+ totalConversations: z.ZodNumber;
73
+ };
74
+ annotations: {
75
+ readOnlyHint: true;
76
+ destructiveHint: false;
77
+ idempotentHint: true;
78
+ };
79
+ execute(args: {
80
+ workspaceId: number;
81
+ limit: number;
82
+ onlyUnread: boolean;
83
+ archiveFilter: "archived" | "all" | "active";
84
+ sinceDate?: string | undefined;
85
+ untilDate?: string | undefined;
86
+ }, client: import("@doist/comms-sdk").CommsApi): Promise<{
87
+ textContent: string;
88
+ structuredContent: FetchInboxStructured;
89
+ }>;
90
+ };
91
+ export { fetchInbox, type FetchInboxStructured };