@sendora/mcp 2.0.2 → 2.0.6
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/dist/errors.js +2 -2
- package/dist/generated/docs.json +1 -1
- package/dist/generated/screens/domain-records.html +1 -1
- package/dist/generated/screens/message-timeline.html +1 -1
- package/dist/tools/inbound.js +2 -1
- package/dist/tools/message-fields.js +1 -1
- package/dist/tools/messages.js +2 -1
- package/dist/tools/page-after.js +14 -0
- package/dist/tools/send-input.js +1 -1
- package/dist/tools/suppressions.js +2 -1
- package/dist/tools/tracking-opt-outs.js +2 -1
- package/dist/tools/webhooks.js +2 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/tools/inbound.js
CHANGED
|
@@ -3,6 +3,7 @@ import { toolError } from '../errors.js';
|
|
|
3
3
|
import { cut, fenced } from '../fence.js';
|
|
4
4
|
import { READING } from '../tool.js';
|
|
5
5
|
import { registerServerTool } from '../target.js';
|
|
6
|
+
import { pageAfter } from './page-after.js';
|
|
6
7
|
/*
|
|
7
8
|
* Received mail (docs/design/mcp.md §5), on a live server alone, since a
|
|
8
9
|
* test server receives nothing. What its sender wrote, the subject, the
|
|
@@ -143,7 +144,7 @@ export const searchInboundInput = z.object({
|
|
|
143
144
|
.optional()
|
|
144
145
|
.describe('Accepted before this time, ISO 8601.'),
|
|
145
146
|
limit: z.number().int().min(1).max(100).default(20).describe('Messages per page, 1 to 100.'),
|
|
146
|
-
after:
|
|
147
|
+
after: pageAfter,
|
|
147
148
|
});
|
|
148
149
|
/** `search_inbound` (docs/design/mcp.md §5): received mail without anything its sender wrote but the From address. */
|
|
149
150
|
export const searchInboundTool = {
|
|
@@ -109,7 +109,7 @@ const headersRecord = z
|
|
|
109
109
|
seen.add(lower);
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
export const customHeaders = atMost(
|
|
112
|
+
export const customHeaders = atMost(50, 'at most 50 headers per message', headersRecord);
|
|
113
113
|
const METADATA_KEY = /^[A-Za-z0-9_.-]{1,40}$/;
|
|
114
114
|
const metadataRecord = z
|
|
115
115
|
.record(z.string(), z
|
package/dist/tools/messages.js
CHANGED
|
@@ -3,6 +3,7 @@ import { toolError } from '../errors.js';
|
|
|
3
3
|
import { messageTimeline, shownIn } from '../screens.js';
|
|
4
4
|
import { READING } from '../tool.js';
|
|
5
5
|
import { registerServerTool } from '../target.js';
|
|
6
|
+
import { pageAfter } from './page-after.js';
|
|
6
7
|
const recipientStatus = z.enum(['queued', 'delivered', 'deferred', 'bounced', 'expired']);
|
|
7
8
|
export const messageOutput = z.object({
|
|
8
9
|
messageId: z.string().describe('The id the log, the events and the webhooks refer to.'),
|
|
@@ -181,7 +182,7 @@ export const searchInput = z.object({
|
|
|
181
182
|
.describe('Submitted at or after this time, ISO 8601.'),
|
|
182
183
|
to: z.iso.datetime({ offset: true }).optional().describe('Submitted before this time, ISO 8601.'),
|
|
183
184
|
limit: z.number().int().min(1).max(100).default(20).describe('Messages per page, 1 to 100.'),
|
|
184
|
-
after:
|
|
185
|
+
after: pageAfter,
|
|
185
186
|
});
|
|
186
187
|
/** `search_messages` (docs/design/mcp.md §4.2): the server's log, filtered, newest first. */
|
|
187
188
|
export const searchMessagesTool = {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// The rule of packages/domain/src/list-cursor.ts, restated since the published
|
|
3
|
+
// package cannot import the domain. test/send-input.test.ts and
|
|
4
|
+
// test/inbound-fields.test.ts check that it refuses what the API refuses, with
|
|
5
|
+
// the same issues.
|
|
6
|
+
const NOT_A_CURSOR = 'Pass the next value of the previous page.';
|
|
7
|
+
const PLACE = /^[A-Za-z0-9_-]{32}$/;
|
|
8
|
+
const rowId = z.uuid();
|
|
9
|
+
export const pageAfter = z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1, { message: NOT_A_CURSOR, abort: true })
|
|
12
|
+
.refine((value) => PLACE.test(value) || rowId.safeParse(value).success, NOT_A_CURSOR)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('The next value of the previous page.');
|
package/dist/tools/send-input.js
CHANGED
|
@@ -23,7 +23,7 @@ export const sendInput = z
|
|
|
23
23
|
html: z.string().min(1).optional().describe('The HTML part.'),
|
|
24
24
|
headers: customHeaders
|
|
25
25
|
.optional()
|
|
26
|
-
.describe('Custom headers by name, at most
|
|
26
|
+
.describe('Custom headers by name, at most 50. Headers Sendora sets itself, such as From, Subject and Content-*, are refused.'),
|
|
27
27
|
attachments: atMost(20, 'at most 20 attachments per message', z.array(attachment).max(20, 'at most 20 attachments per message'))
|
|
28
28
|
.optional()
|
|
29
29
|
.describe('At most 20, together at most 5 MB decoded.'),
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { toolError } from '../errors.js';
|
|
3
3
|
import { READING } from '../tool.js';
|
|
4
4
|
import { modesOf, registerServerTool } from '../target.js';
|
|
5
|
+
import { pageAfter } from './page-after.js';
|
|
5
6
|
export const suppressionOutput = z.object({
|
|
6
7
|
streamId: z.string().describe('The stream whose list the address is on.'),
|
|
7
8
|
address: z.string().describe('The recipient, lower-cased.'),
|
|
@@ -38,7 +39,7 @@ export const listSuppressionsTool = {
|
|
|
38
39
|
.max(100)
|
|
39
40
|
.default(20)
|
|
40
41
|
.describe('Addresses per page, 1 to 100.'),
|
|
41
|
-
after:
|
|
42
|
+
after: pageAfter,
|
|
42
43
|
}),
|
|
43
44
|
outputSchema: z.object({
|
|
44
45
|
suppressions: z.array(suppressionOutput).describe('The page of the list.'),
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { toolError } from '../errors.js';
|
|
3
3
|
import { READING } from '../tool.js';
|
|
4
4
|
import { modesOf, registerServerTool } from '../target.js';
|
|
5
|
+
import { pageAfter } from './page-after.js';
|
|
5
6
|
export const trackingOptOutOutput = z.object({
|
|
6
7
|
address: z
|
|
7
8
|
.string()
|
|
@@ -36,7 +37,7 @@ export const listTrackingOptOutsTool = {
|
|
|
36
37
|
.max(100)
|
|
37
38
|
.default(20)
|
|
38
39
|
.describe('Addresses per page, 1 to 100.'),
|
|
39
|
-
after:
|
|
40
|
+
after: pageAfter,
|
|
40
41
|
}),
|
|
41
42
|
outputSchema: z.object({
|
|
42
43
|
trackingOptOuts: z.array(trackingOptOutOutput).describe('The page of the list.'),
|
package/dist/tools/webhooks.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { toolError } from '../errors.js';
|
|
3
3
|
import { READING } from '../tool.js';
|
|
4
4
|
import { registerServerTool } from '../target.js';
|
|
5
|
+
import { pageAfter } from './page-after.js';
|
|
5
6
|
const eventName = z.enum([
|
|
6
7
|
'delivered',
|
|
7
8
|
'bounced',
|
|
@@ -137,7 +138,7 @@ export const listWebhookDeliveriesTool = {
|
|
|
137
138
|
.max(100)
|
|
138
139
|
.default(20)
|
|
139
140
|
.describe('Deliveries per page, 1 to 100.'),
|
|
140
|
-
after:
|
|
141
|
+
after: pageAfter,
|
|
141
142
|
}),
|
|
142
143
|
outputSchema: z.object({
|
|
143
144
|
deliveries: z.array(deliveryOutput).describe('The page of deliveries, newest first.'),
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, held equal to its package.json by a test. */
|
|
2
|
-
export const MCP_VERSION = '2.0.
|
|
2
|
+
export const MCP_VERSION = '2.0.6';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendora/mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "The official MCP server for Sendora: its documentation and API for coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"vitest": "^4.1.11",
|
|
42
42
|
"@sendora/api": "0.0.0",
|
|
43
43
|
"@sendora/db": "0.0.0",
|
|
44
|
-
"@sendora/observability": "0.0.0",
|
|
45
44
|
"@sendora/domain": "0.0.0",
|
|
45
|
+
"@sendora/observability": "0.0.0",
|
|
46
46
|
"@sendora/site": "0.0.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|