@postman/postman-mcp-server 2.7.1 → 2.8.1
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/package.json +6 -4
- package/dist/src/clients/postman.js +2 -0
- package/dist/src/enabledResources.js +7 -5
- package/dist/src/index.js +29 -1
- package/dist/src/tools/addWorkspaceToPrivateNetwork.js +47 -0
- package/dist/src/tools/createCollectionRequest.js +9 -12
- package/dist/src/tools/createCollectionResponse.js +109 -398
- package/dist/src/tools/createWorkspace.js +2 -2
- package/dist/src/tools/deleteWorkspace.js +1 -1
- package/dist/src/tools/getAnalyticsData.js +107 -0
- package/dist/src/tools/getAnalyticsMetadata.js +55 -0
- package/dist/src/tools/getWorkspace.js +1 -1
- package/dist/src/tools/{getAllPanAddElementRequests.js → listPrivateNetworkAddRequests.js} +9 -16
- package/dist/src/tools/{getAllElementsAndFolders.js → listPrivateNetworkWorkspaces.js} +27 -34
- package/dist/src/tools/publishDocumentation.js +1 -1
- package/dist/src/tools/putCollection.js +1 -1
- package/dist/src/tools/removeWorkspaceFromPrivateNetwork.js +36 -0
- package/dist/src/tools/resolveCommentThread.js +1 -1
- package/dist/src/tools/respondPrivateNetworkAddRequest.js +56 -0
- package/dist/src/tools/updateCollectionRequest.js +6 -12
- package/dist/src/tools/updateCollectionResponse.js +113 -0
- package/dist/src/tools/updateWorkspace.js +1 -1
- package/dist/src/tools/utils/errorTemplateRenderer.js +23 -0
- package/dist/src/views/errors/getCollectionFolder.404.njk +5 -0
- package/dist/src/views/errors/getCollectionRequest.404.njk +5 -0
- package/dist/src/views/errors/getCollectionResponse.404.njk +5 -0
- package/dist/src/views/errors/getEnvironment.404.njk +5 -0
- package/dist/src/views/errors/getMock.404.njk +5 -0
- package/dist/src/views/errors/getMonitor.404.njk +5 -0
- package/dist/src/views/errors/getSpec.404.njk +5 -0
- package/dist/src/views/errors/getWorkspace.404.njk +5 -0
- package/package.json +15 -15
- package/dist/src/tools/deletePanElementOrFolder.js +0 -41
- package/dist/src/tools/postPanElementOrFolder.js +0 -84
- package/dist/src/tools/updatePanElementOrFolder.js +0 -100
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
+
export const method = 'getAnalyticsData';
|
|
4
|
+
export const description = 'Gets analytics data based on the specified resource, metrics, and given filters for team, internal, and public workspaces, as well as Partner Workspaces.\n\n**Note:**\n\nThis endpoint only accepts the following resource:metric query parameter combinations:\n- \\`user\\` — \\`workspace_active_users\\`, \\`active_users\\`\n- \\`workspace\\` — \\`elements_in_workspace\\`, \\`active_workspaces\\`, \\`api_calls\\`, \\`active_collections\\`, \\`response_status\\`, \\`pending_invites\\`, \\`needs_attention\\`, \\`success_rate\\`, \\`user_requests\\`, \\`collection_error_aggregate\\`\n- \\`team\\` — \\`user_api_journey\\`, \\`workspace_distribution\\`, \\`internal_workspace_distribution\\`, \\`license_consumption\\`, \\`partner_engagement_funnel\\`\n\nThe \\`view\\` query parameter only accepts the following values when called with the following resource:metric pairs:\n- \\`detailed\\` or \\`summary\\` — \\`user:active_users\\`, \\`workspace:active_workspaces\\`, \\`workspace:pending_invites\\`, \\`workspace:needs_attention\\`, \\`workspace:success_rate\\`, \\`team:partner_engagement_funnel\\`\n\\`summary\\` only — \\`workspace:elements_in_workspace\\`, \\`workspace:workspace_active_users\\`, \\`workspace:api_calls\\`, \\`workspace:response_status\\`, \\`team:user_api_journey\\`, \\`team:workspace_distribution\\`, \\`team:internal_workspace_distribution\\`, \\`team:license_consumption\\`\n- \\`detailed\\` only — \\`workspace:active_collections\\`, \\`workspace:user_requests\\`\n';
|
|
5
|
+
export const parameters = z.object({
|
|
6
|
+
resource: z
|
|
7
|
+
.enum(['user', 'team', 'workspace'])
|
|
8
|
+
.describe('Returns metrics and insights for API usage, success, and workspace/team trends in Postman:\n\n- `user` — Data related to individual user activities and engagement within Postman workspaces.\n- `team` — Team-level analytics, license consumption, and organizational trends.\n- `workspace` — Workspace-level activities, elements, and collaboration patterns.\n'),
|
|
9
|
+
metrics: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe('Filters the response by only the given metrics. The metric must match the given `resource` value.\n\nFor a list of metrics and their related `resource` value, call the GET `/analytics-metadata` endpoint.\n'),
|
|
12
|
+
view: z
|
|
13
|
+
.enum(['detailed', 'summary'])
|
|
14
|
+
.describe('The view type for the analytics data:\n - `detailed` — Return extensive information.\n - `summary` — Return aggregated information.\n')
|
|
15
|
+
.optional(),
|
|
16
|
+
workspaceType: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe('A comma-separated list of `internal`, `public`, and `partner` workspace types to filter the results by.')
|
|
19
|
+
.optional(),
|
|
20
|
+
userId: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe('A comma-separated list of user IDs to filter the results by. Only pass this parameter when calling the `user_requests` metric for the `workspace` resource.')
|
|
23
|
+
.optional(),
|
|
24
|
+
duration: z
|
|
25
|
+
.enum(['last_30_days', 'last_180_days', 'last_month', 'last_6_months'])
|
|
26
|
+
.describe('Filters the response by the given duration.')
|
|
27
|
+
.optional(),
|
|
28
|
+
requestId: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe('A comma-separated list of unique request IDs (`userId`-`requestId`) to filter the response by. Only pass this parameter when using the `user_requests` metric.')
|
|
31
|
+
.optional(),
|
|
32
|
+
responseStatus: z
|
|
33
|
+
.string()
|
|
34
|
+
.describe('A comma-separated list of HTTP response status codes to filter the results by. Accepts values `100` through `600`. Only pass this parameter when using the `user_requests` metric.')
|
|
35
|
+
.optional(),
|
|
36
|
+
attentionType: z
|
|
37
|
+
.string()
|
|
38
|
+
.describe('A comma-separated list of issues types to filter the results by. Attention types provide details about issues users or partners are facing. Accepts the `high_non_200OK_rate_for_partner` and `no_success_on_tried_request` values. Only pass this parameter when using the `needs_attention` metric.')
|
|
39
|
+
.optional(),
|
|
40
|
+
limit: z
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.gte(1)
|
|
44
|
+
.lte(10000)
|
|
45
|
+
.describe('The maximum number of rows to return in the response.')
|
|
46
|
+
.default(100),
|
|
47
|
+
offset: z
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.gte(0)
|
|
51
|
+
.lte(10000)
|
|
52
|
+
.describe('The zero-based offset of the first item to return.')
|
|
53
|
+
.default(0),
|
|
54
|
+
});
|
|
55
|
+
export const annotations = {
|
|
56
|
+
title: 'Gets analytics data based on the specified resource, metrics, and given filters for team, internal, and public workspaces, as well as Partner Workspaces.',
|
|
57
|
+
readOnlyHint: true,
|
|
58
|
+
destructiveHint: false,
|
|
59
|
+
idempotentHint: true,
|
|
60
|
+
};
|
|
61
|
+
export async function handler(args, extra) {
|
|
62
|
+
try {
|
|
63
|
+
const endpoint = `/analytics`;
|
|
64
|
+
const query = new URLSearchParams();
|
|
65
|
+
if (args.resource !== undefined)
|
|
66
|
+
query.set('resource', String(args.resource));
|
|
67
|
+
if (args.metrics !== undefined)
|
|
68
|
+
query.set('metrics', String(args.metrics));
|
|
69
|
+
if (args.view !== undefined)
|
|
70
|
+
query.set('view', String(args.view));
|
|
71
|
+
if (args.workspaceType !== undefined)
|
|
72
|
+
query.set('workspaceType', String(args.workspaceType));
|
|
73
|
+
if (args.userId !== undefined)
|
|
74
|
+
query.set('userId', String(args.userId));
|
|
75
|
+
if (args.duration !== undefined)
|
|
76
|
+
query.set('duration', String(args.duration));
|
|
77
|
+
if (args.requestId !== undefined)
|
|
78
|
+
query.set('requestId', String(args.requestId));
|
|
79
|
+
if (args.responseStatus !== undefined)
|
|
80
|
+
query.set('responseStatus', String(args.responseStatus));
|
|
81
|
+
if (args.attentionType !== undefined)
|
|
82
|
+
query.set('attentionType', String(args.attentionType));
|
|
83
|
+
if (args.limit !== undefined)
|
|
84
|
+
query.set('limit', String(args.limit));
|
|
85
|
+
if (args.offset !== undefined)
|
|
86
|
+
query.set('offset', String(args.offset));
|
|
87
|
+
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
88
|
+
const options = {
|
|
89
|
+
headers: extra.headers,
|
|
90
|
+
};
|
|
91
|
+
const result = await extra.client.get(url, options);
|
|
92
|
+
return {
|
|
93
|
+
content: [
|
|
94
|
+
{
|
|
95
|
+
type: 'text',
|
|
96
|
+
text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
if (e instanceof McpError) {
|
|
103
|
+
throw e;
|
|
104
|
+
}
|
|
105
|
+
throw asMcpError(e);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
+
export const method = 'getAnalyticsMetadata';
|
|
4
|
+
export const description = 'Returns a catalog of analytics resources and their corresponding metrics for use with the GET /analytics endpoint. These metrics provide insights on API usage, success, workspace, and team trends in Postman.';
|
|
5
|
+
export const parameters = z.object({
|
|
6
|
+
include: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe('A comma-separated list of the additional information to include in the response. Accepts the `parameters` and `response` values.\n\nWhen you pass this query parameter and its values, the response provides detailed information, including parameters and response schemas for the given metrics.\n')
|
|
9
|
+
.optional(),
|
|
10
|
+
resources: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('A comma-separated list of resource types to filter the metrics by. Accepts the `user`, `workspace`, and `team` values.')
|
|
13
|
+
.optional(),
|
|
14
|
+
metrics: z
|
|
15
|
+
.string()
|
|
16
|
+
.describe("A comma-separated list of metrics values to use to filter the response.\n\nIf you don't pass this query parameter, then the response returns all metadata for all available metrics.\n")
|
|
17
|
+
.optional(),
|
|
18
|
+
});
|
|
19
|
+
export const annotations = {
|
|
20
|
+
title: 'Returns a catalog of analytics resources and their corresponding metrics for use with the GET /analytics endpoint. These metrics provide insights on API usage, success, workspace, and team trends in Postman.',
|
|
21
|
+
readOnlyHint: true,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
idempotentHint: true,
|
|
24
|
+
};
|
|
25
|
+
export async function handler(args, extra) {
|
|
26
|
+
try {
|
|
27
|
+
const endpoint = `/analytics-metadata`;
|
|
28
|
+
const query = new URLSearchParams();
|
|
29
|
+
if (args.include !== undefined)
|
|
30
|
+
query.set('include', String(args.include));
|
|
31
|
+
if (args.resources !== undefined)
|
|
32
|
+
query.set('resources', String(args.resources));
|
|
33
|
+
if (args.metrics !== undefined)
|
|
34
|
+
query.set('metrics', String(args.metrics));
|
|
35
|
+
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
36
|
+
const options = {
|
|
37
|
+
headers: extra.headers,
|
|
38
|
+
};
|
|
39
|
+
const result = await extra.client.get(url, options);
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: 'text',
|
|
44
|
+
text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
if (e instanceof McpError) {
|
|
51
|
+
throw e;
|
|
52
|
+
}
|
|
53
|
+
throw asMcpError(e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
3
|
export const method = 'getWorkspace';
|
|
4
|
-
export const description = "Gets information about a workspace.\n\n**Note:**\n\nThis endpoint's response contains the \\`visibility\\` field. [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility) determines who can access the workspace:\n- \\`personal\\` — Only you can access the workspace.\n- \\`team\\` — All team members can access the workspace.\n- \\`private\\` — Only invited team members can access the workspace ([**
|
|
4
|
+
export const description = "Gets information about a workspace.\n\n**Note:**\n\nThis endpoint's response contains the \\`visibility\\` field. [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility) determines who can access the workspace:\n- \\`personal\\` — Only you can access the workspace.\n- \\`team\\` — All team members can access the workspace.\n- \\`private\\` — Only invited team members can access the workspace ([**Team** and **Enterprise** plans only](https://www.postman.com/pricing)).\n- \\`public\\` — Everyone can access the workspace.\n- \\`partner\\` — Only invited team members and [partners](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) can access the workspace ([**Team** and **Enterprise** plans only](https://www.postman.com/pricing)).\n";
|
|
5
5
|
export const parameters = z.object({
|
|
6
6
|
workspaceId: z.string().describe("The workspace's ID."),
|
|
7
7
|
include: z
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
-
export const method = '
|
|
4
|
-
export const description = "Gets
|
|
3
|
+
export const method = 'listPrivateNetworkAddRequests';
|
|
4
|
+
export const description = "Gets all requests to add workspaces to your team's Private API Network.\n\nWARNING: This tool is for Private API Network management, not for general workspace operations. For workspace management use: getWorkspaces, getWorkspace, createWorkspace, updateWorkspace, deleteWorkspace.\n";
|
|
5
5
|
export const parameters = z.object({
|
|
6
6
|
since: z
|
|
7
7
|
.string()
|
|
8
8
|
.datetime({ offset: true })
|
|
9
|
-
.describe('Return only results created since the given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be later than the `until` value. To use time-numoffset format, you must use `%2B` URL-encoding for the `+` character.')
|
|
9
|
+
.describe('Return only results created since the given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be later than the `until` value. To use `time-numoffset` format, you must use `%2B` URL-encoding for the `+` character.')
|
|
10
10
|
.optional(),
|
|
11
11
|
until: z
|
|
12
12
|
.string()
|
|
13
13
|
.datetime({ offset: true })
|
|
14
|
-
.describe('Return only results created until this given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be earlier than the `since` value. To use time-numoffset format, you must use `%2B` URL-encoding for the `+` character.')
|
|
15
|
-
.optional(),
|
|
16
|
-
requestedBy: z
|
|
17
|
-
.number()
|
|
18
|
-
.int()
|
|
19
|
-
.describe("Return a user's element requests by their user ID.")
|
|
20
|
-
.optional(),
|
|
21
|
-
type: z
|
|
22
|
-
.enum(['api', 'folder', 'collection', 'workspace'])
|
|
23
|
-
.describe('Filter by the element type.')
|
|
14
|
+
.describe('Return only results created until this given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be earlier than the `since` value. To use `time-numoffset` format, you must use `%2B` URL-encoding for the `+` character.')
|
|
24
15
|
.optional(),
|
|
16
|
+
requestedBy: z.number().int().describe("Return a user's requests by their user ID.").optional(),
|
|
17
|
+
type: z.literal('workspace').describe('The `workspace` value.').optional(),
|
|
25
18
|
status: z.enum(['pending', 'denied']).describe('Filter by the request status.').optional(),
|
|
26
19
|
name: z
|
|
27
20
|
.string()
|
|
28
|
-
.describe('Return only
|
|
21
|
+
.describe('Return only workspaces whose name includes the given value. Matching is not case-sensitive.')
|
|
29
22
|
.optional(),
|
|
30
23
|
sort: z
|
|
31
24
|
.enum(['createdAt', 'updatedAt'])
|
|
@@ -43,11 +36,11 @@ export const parameters = z.object({
|
|
|
43
36
|
limit: z
|
|
44
37
|
.number()
|
|
45
38
|
.int()
|
|
46
|
-
.describe('The maximum number of
|
|
39
|
+
.describe('The maximum number of results to return. If the value exceeds the maximum value of `1000`, then the system uses the `1000` value.')
|
|
47
40
|
.default(1000),
|
|
48
41
|
});
|
|
49
42
|
export const annotations = {
|
|
50
|
-
title: "Gets
|
|
43
|
+
title: "Gets all requests to add workspaces to your team's Private API Network.",
|
|
51
44
|
readOnlyHint: true,
|
|
52
45
|
destructiveHint: false,
|
|
53
46
|
idempotentHint: true,
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
-
export const method = '
|
|
4
|
-
export const description = "Gets information about
|
|
3
|
+
export const method = 'listPrivateNetworkWorkspaces';
|
|
4
|
+
export const description = "Gets information about workspaces added to your team's Private API Network.\n\nWARNING: This tool is for Private API Network management, not for general workspace operations. For workspace management use: getWorkspaces, getWorkspace, createWorkspace, updateWorkspace, deleteWorkspace.\n";
|
|
5
5
|
export const parameters = z.object({
|
|
6
|
+
type: z.literal('workspace').describe('The `workspace` value.').optional(),
|
|
7
|
+
name: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('Return only workspaces whose name includes the given value. Matching is not case-sensitive.')
|
|
10
|
+
.optional(),
|
|
11
|
+
summary: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe('Return only workspaces whose summary includes the given value. Matching is not case-sensitive.')
|
|
14
|
+
.optional(),
|
|
15
|
+
description: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('Return only workspaces whose description includes the given value. Matching is not case-sensitive.')
|
|
18
|
+
.optional(),
|
|
6
19
|
since: z
|
|
7
20
|
.string()
|
|
8
21
|
.datetime({ offset: true })
|
|
@@ -16,19 +29,7 @@ export const parameters = z.object({
|
|
|
16
29
|
addedBy: z
|
|
17
30
|
.number()
|
|
18
31
|
.int()
|
|
19
|
-
.describe('Return only
|
|
20
|
-
.optional(),
|
|
21
|
-
name: z
|
|
22
|
-
.string()
|
|
23
|
-
.describe('Return only elements whose name includes the given value. Matching is not case-sensitive.')
|
|
24
|
-
.optional(),
|
|
25
|
-
summary: z
|
|
26
|
-
.string()
|
|
27
|
-
.describe('Return only elements whose summary includes the given value. Matching is not case-sensitive.')
|
|
28
|
-
.optional(),
|
|
29
|
-
description: z
|
|
30
|
-
.string()
|
|
31
|
-
.describe('Return only elements whose description includes the given value. Matching is not case-sensitive.')
|
|
32
|
+
.describe('Return only workspaces published by the given user ID.')
|
|
32
33
|
.optional(),
|
|
33
34
|
sort: z
|
|
34
35
|
.enum(['createdAt', 'updatedAt'])
|
|
@@ -51,20 +52,12 @@ export const parameters = z.object({
|
|
|
51
52
|
limit: z
|
|
52
53
|
.number()
|
|
53
54
|
.int()
|
|
54
|
-
.describe('The maximum number of
|
|
55
|
+
.describe('The maximum number of results to return. If the value exceeds the maximum value of `1000`, then the system uses the `1000` value.')
|
|
55
56
|
.default(1000),
|
|
56
|
-
parentFolderId: z
|
|
57
|
-
.number()
|
|
58
|
-
.int()
|
|
59
|
-
.describe("Return the folders and elements in a specific folder. If this value is `0`, then the endpoint only returns the root folder's elements.")
|
|
60
|
-
.default(0),
|
|
61
|
-
type: z
|
|
62
|
-
.enum(['api', 'folder', 'collection', 'workspace'])
|
|
63
|
-
.describe('Filter by the element type.')
|
|
64
|
-
.optional(),
|
|
57
|
+
parentFolderId: z.number().int().describe('This parameter is deprecated.').default(0),
|
|
65
58
|
});
|
|
66
59
|
export const annotations = {
|
|
67
|
-
title: "Gets information about
|
|
60
|
+
title: "Gets information about workspaces added to your team's Private API Network.",
|
|
68
61
|
readOnlyHint: true,
|
|
69
62
|
destructiveHint: false,
|
|
70
63
|
idempotentHint: true,
|
|
@@ -73,18 +66,20 @@ export async function handler(args, extra) {
|
|
|
73
66
|
try {
|
|
74
67
|
const endpoint = `/network/private`;
|
|
75
68
|
const query = new URLSearchParams();
|
|
76
|
-
if (args.
|
|
77
|
-
query.set('
|
|
78
|
-
if (args.until !== undefined)
|
|
79
|
-
query.set('until', String(args.until));
|
|
80
|
-
if (args.addedBy !== undefined)
|
|
81
|
-
query.set('addedBy', String(args.addedBy));
|
|
69
|
+
if (args.type !== undefined)
|
|
70
|
+
query.set('type', String(args.type));
|
|
82
71
|
if (args.name !== undefined)
|
|
83
72
|
query.set('name', String(args.name));
|
|
84
73
|
if (args.summary !== undefined)
|
|
85
74
|
query.set('summary', String(args.summary));
|
|
86
75
|
if (args.description !== undefined)
|
|
87
76
|
query.set('description', String(args.description));
|
|
77
|
+
if (args.since !== undefined)
|
|
78
|
+
query.set('since', String(args.since));
|
|
79
|
+
if (args.until !== undefined)
|
|
80
|
+
query.set('until', String(args.until));
|
|
81
|
+
if (args.addedBy !== undefined)
|
|
82
|
+
query.set('addedBy', String(args.addedBy));
|
|
88
83
|
if (args.sort !== undefined)
|
|
89
84
|
query.set('sort', String(args.sort));
|
|
90
85
|
if (args.direction !== undefined)
|
|
@@ -97,8 +92,6 @@ export async function handler(args, extra) {
|
|
|
97
92
|
query.set('limit', String(args.limit));
|
|
98
93
|
if (args.parentFolderId !== undefined)
|
|
99
94
|
query.set('parentFolderId', String(args.parentFolderId));
|
|
100
|
-
if (args.type !== undefined)
|
|
101
|
-
query.set('type', String(args.type));
|
|
102
95
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
103
96
|
const options = {
|
|
104
97
|
headers: extra.headers,
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
3
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
4
|
export const method = 'publishDocumentation';
|
|
5
|
-
export const description = "Publishes a collection's documentation. This makes it publicly available to anyone with the link to the documentation.\n\n**Note:**\n\n- Your [Postman plan](https://www.postman.com/pricing/) impacts your use of these endpoints:\n - For **Free** and **
|
|
5
|
+
export const description = "Publishes a collection's documentation. This makes it publicly available to anyone with the link to the documentation.\n\n**Note:**\n\n- Your [Postman plan](https://www.postman.com/pricing/) impacts your use of these endpoints:\n - For **Free** and **Solo** users, you must have permissions to edit the collection.\n - If [API Governance and Security](https://learning.postman.com/docs/api-governance/configurable-rules/configurable-rules-overview/) is enabled for your [**Enterprise**](https://www.postman.com/pricing/) team, only users with the [Community Manager role](https://learning.postman.com/docs/collaborating-in-postman/roles-and-permissions/#team-roles) can publish documentation.\n- Publishing is only supported for collections with HTTP requests.\n- You cannot publish a collection added to an API.\n";
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
collectionId: z.string().describe("The collection's unique ID."),
|
|
8
8
|
environmentUid: z
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
3
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
4
|
export const method = 'putCollection';
|
|
5
|
-
export const description = "Replaces the contents of a collection using the [Postman Collection v2.1.0 schema format](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html). Include the collection's ID values in the request body. If you do not, the endpoint removes the existing items and creates new items.\n\
|
|
5
|
+
export const description = "Replaces the contents of a collection using the [Postman Collection v2.1.0 schema format](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html). Include the collection's ID values in the request body. If you do not, the endpoint removes the existing items and creates new items.\n\n- To perform an update asynchronously, use the \\`Prefer\\` header with the \\`respond-async\\` value. When performing an async update, this endpoint returns a HTTP \\`202 Accepted\\` response.\n- For a complete list of properties and information, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).\n- For protocol profile behavior, refer to Postman's [Protocol Profile Behavior documentation](https://github.com/postmanlabs/postman-runtime/blob/develop/docs/protocol-profile-behavior.md).\n\n**Note:**\n\n- The maximum collection size this endpoint accepts cannot exceed 100 MB.\n- Use the GET \\`/collection-updates-tasks/{taskId}\\` endpoint to get the collection's update status when performing an asynchronous update.\n- If you don't include the collection items' ID values from the request body, the endpoint **removes** the existing items and recreates the items with new ID values.\n- To copy another collection's contents to the given collection, remove all ID values before you pass it in this endpoint. If you do not, this endpoint returns an error. These values include the \\`id\\`, \\`uid\\`, and \\`postman_id\\` values.\n";
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
collectionId: z
|
|
8
8
|
.string()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
+
export const method = 'removeWorkspaceFromPrivateNetwork';
|
|
4
|
+
export const description = "Removes a workspace from your team's Private API Network. This does not delete the workspace itself — it only removes it from the Private API Network folder.\n\nWARNING: This tool is for Private API Network management, not for general workspace operations. For workspace management use: getWorkspaces, getWorkspace, createWorkspace, updateWorkspace, deleteWorkspace.\n";
|
|
5
|
+
export const parameters = z.object({ workspaceId: z.string().describe("The workspace's ID.") });
|
|
6
|
+
export const annotations = {
|
|
7
|
+
title: "Removes a workspace from your team's Private API Network. This does not delete the workspace itself — it only removes it from the Private API Network folder.",
|
|
8
|
+
readOnlyHint: false,
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
};
|
|
12
|
+
export async function handler(args, extra) {
|
|
13
|
+
try {
|
|
14
|
+
const endpoint = `/network/private/workspace/${args.workspaceId}`;
|
|
15
|
+
const query = new URLSearchParams();
|
|
16
|
+
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
17
|
+
const options = {
|
|
18
|
+
headers: extra.headers,
|
|
19
|
+
};
|
|
20
|
+
const result = await extra.client.delete(url, options);
|
|
21
|
+
return {
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (e instanceof McpError) {
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
34
|
+
throw asMcpError(e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
3
|
export const method = 'resolveCommentThread';
|
|
4
|
-
export const description = 'Resolves a comment and any associated replies. On success, this returns an HTTP \\`204 No Content\\` response.\n\nComment thread IDs return in the GET comments response for [
|
|
4
|
+
export const description = 'Resolves a comment and any associated replies. On success, this returns an HTTP \\`204 No Content\\` response.\n\nComment thread IDs return in the GET \\`/comments\\` response for [collections](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-a6582e0a-9382-4760-8b91-53a8aa6cb8d7) and [collection items](https://www.postman.com/postman/workspace/postman-public-workspace/folder/12959542-efeda219-66e1-474c-a83b-253d15723bf7).\n';
|
|
5
5
|
export const parameters = z.object({
|
|
6
6
|
threadId: z.number().int().describe("The comment's thread ID."),
|
|
7
7
|
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ContentType } from '../clients/postman.js';
|
|
3
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
|
+
export const method = 'respondPrivateNetworkAddRequest';
|
|
5
|
+
export const description = "Responds to a user's request to add a workspace to your team's Private API Network. Only managers can approve or deny a request. Once approved, the workspace will appear in the team's Private API Network.\n\nWARNING: This tool is for Private API Network management, not for general workspace operations. For workspace management use: getWorkspaces, getWorkspace, createWorkspace, updateWorkspace, deleteWorkspace.\n";
|
|
6
|
+
export const parameters = z.object({
|
|
7
|
+
requestId: z.number().int().describe("The request's ID."),
|
|
8
|
+
status: z.enum(['denied', 'approved']).describe("The request's approval status."),
|
|
9
|
+
response: z
|
|
10
|
+
.object({
|
|
11
|
+
message: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("A message that details why the user's request was denied.")
|
|
14
|
+
.optional(),
|
|
15
|
+
})
|
|
16
|
+
.describe("If the request is denied, the response to the user's request.")
|
|
17
|
+
.optional(),
|
|
18
|
+
});
|
|
19
|
+
export const annotations = {
|
|
20
|
+
title: "Responds to a user's request to add a workspace to your team's Private API Network. Only managers can approve or deny a request. Once approved, the workspace will appear in the team's Private API Network.",
|
|
21
|
+
readOnlyHint: false,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
idempotentHint: true,
|
|
24
|
+
};
|
|
25
|
+
export async function handler(args, extra) {
|
|
26
|
+
try {
|
|
27
|
+
const endpoint = `/network/private/network-entity/request/${args.requestId}`;
|
|
28
|
+
const query = new URLSearchParams();
|
|
29
|
+
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
30
|
+
const bodyPayload = {};
|
|
31
|
+
if (args.status !== undefined)
|
|
32
|
+
bodyPayload.status = args.status;
|
|
33
|
+
if (args.response !== undefined)
|
|
34
|
+
bodyPayload.response = args.response;
|
|
35
|
+
const options = {
|
|
36
|
+
body: JSON.stringify(bodyPayload),
|
|
37
|
+
contentType: ContentType.Json,
|
|
38
|
+
headers: extra.headers,
|
|
39
|
+
};
|
|
40
|
+
const result = await extra.client.put(url, options);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
if (e instanceof McpError) {
|
|
52
|
+
throw e;
|
|
53
|
+
}
|
|
54
|
+
throw asMcpError(e);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -6,7 +6,7 @@ export const description = 'Updates a request in a collection. For a complete li
|
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
requestId: z.string().describe("The request's ID."),
|
|
8
8
|
collectionId: z.string().describe("The collection's ID."),
|
|
9
|
-
name: z.string().describe(
|
|
9
|
+
name: z.string().describe("The request's name.").optional(),
|
|
10
10
|
description: z.string().nullable().describe("The request's description.").optional(),
|
|
11
11
|
method: z
|
|
12
12
|
.enum([
|
|
@@ -26,7 +26,6 @@ export const parameters = z.object({
|
|
|
26
26
|
'PROPFIND',
|
|
27
27
|
'VIEW',
|
|
28
28
|
])
|
|
29
|
-
.nullable()
|
|
30
29
|
.describe("The request's HTTP method.")
|
|
31
30
|
.optional(),
|
|
32
31
|
url: z.string().nullable().describe("The request's URL.").optional(),
|
|
@@ -34,7 +33,7 @@ export const parameters = z.object({
|
|
|
34
33
|
.array(z.object({
|
|
35
34
|
key: z.string().describe("The header's key.").optional(),
|
|
36
35
|
value: z.string().describe("The header's value.").optional(),
|
|
37
|
-
description: z.string().
|
|
36
|
+
description: z.string().describe("The header's description.").optional(),
|
|
38
37
|
}))
|
|
39
38
|
.describe("The request's headers.")
|
|
40
39
|
.optional(),
|
|
@@ -42,25 +41,20 @@ export const parameters = z.object({
|
|
|
42
41
|
.array(z.object({
|
|
43
42
|
key: z.string().describe("The query parameter's key.").optional(),
|
|
44
43
|
value: z.string().describe("The query parameter's value.").optional(),
|
|
45
|
-
description: z
|
|
46
|
-
.string()
|
|
47
|
-
.nullable()
|
|
48
|
-
.describe("The query parameter's description.")
|
|
49
|
-
.optional(),
|
|
44
|
+
description: z.string().describe("The query parameter's description.").optional(),
|
|
50
45
|
enabled: z.boolean().describe('If true, the query parameter is enabled.').optional(),
|
|
51
46
|
}))
|
|
52
47
|
.describe("The request's query parameters.")
|
|
53
48
|
.optional(),
|
|
54
49
|
dataMode: z
|
|
55
50
|
.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql'])
|
|
56
|
-
.nullable()
|
|
57
51
|
.describe("The request body's data mode.")
|
|
58
52
|
.optional(),
|
|
59
53
|
data: z
|
|
60
54
|
.array(z.object({
|
|
61
55
|
key: z.string().describe("The form data's key.").optional(),
|
|
62
56
|
value: z.string().describe("The form data's value.").optional(),
|
|
63
|
-
description: z.string().
|
|
57
|
+
description: z.string().describe("The form data's description.").optional(),
|
|
64
58
|
enabled: z.boolean().describe('If true, the form data entry is enabled.').optional(),
|
|
65
59
|
type: z.enum(['text', 'file']).describe("The form data's type.").optional(),
|
|
66
60
|
uuid: z.string().describe("The form data entry's unique identifier.").optional(),
|
|
@@ -81,7 +75,6 @@ export const parameters = z.object({
|
|
|
81
75
|
.object({
|
|
82
76
|
raw: z
|
|
83
77
|
.object({ language: z.string().describe("The raw mode data's language type.").optional() })
|
|
84
|
-
.catchall(z.unknown())
|
|
85
78
|
.describe('Options for the `raw` data mode.')
|
|
86
79
|
.optional(),
|
|
87
80
|
urlencoded: z
|
|
@@ -321,7 +314,7 @@ export const parameters = z.object({
|
|
|
321
314
|
.optional(),
|
|
322
315
|
events: z
|
|
323
316
|
.array(z.object({
|
|
324
|
-
listen: z.enum(['test', 'prerequest']).describe('The event type.'),
|
|
317
|
+
listen: z.enum(['test', 'prerequest']).describe('The event type.').optional(),
|
|
325
318
|
script: z
|
|
326
319
|
.object({
|
|
327
320
|
id: z.string().describe("The script's ID.").optional(),
|
|
@@ -337,6 +330,7 @@ export const parameters = z.object({
|
|
|
337
330
|
.describe('Information about the Javascript code that can be used to to perform setup or teardown operations in a response.')
|
|
338
331
|
.optional(),
|
|
339
332
|
}))
|
|
333
|
+
.nullable()
|
|
340
334
|
.describe('A list of scripts configured to run when specific events occur.')
|
|
341
335
|
.optional(),
|
|
342
336
|
});
|