@postman/postman-mcp-server 2.7.0 → 2.8.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 +32 -0
- package/dist/package.json +15 -13
- package/dist/src/clients/postman.js +2 -0
- package/dist/src/enabledResources.js +14 -9
- package/dist/src/index.js +29 -1
- package/dist/src/tools/addWorkspaceToPrivateNetwork.js +47 -0
- package/dist/src/tools/createCollectionRequest.js +255 -94
- package/dist/src/tools/createCollectionResponse.js +125 -3
- package/dist/src/tools/createSpec.js +16 -4
- package/dist/src/tools/createWorkspace.js +6 -2
- package/dist/src/tools/deleteWorkspace.js +1 -1
- package/dist/src/tools/generateCollection.js +2 -2
- package/dist/src/tools/getAnalyticsData.js +107 -0
- package/dist/src/tools/getAnalyticsMetadata.js +55 -0
- package/dist/src/tools/getCodeGenerationInstructions.js +12 -6
- package/dist/src/tools/getCollection/getCollectionMap.js +2 -2
- 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/pullCollectionChanges.js +3 -1
- package/dist/src/tools/putCollection.js +11 -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/searchPostmanElementsInPrivateNetwork.js +127 -0
- package/dist/src/tools/{searchPostmanElements.js → searchPostmanElementsInPublicNetwork.js} +1 -1
- package/dist/src/tools/updateCollectionRequest.js +254 -97
- 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/dist/src/views/getWorkspaces.njk +3 -3
- package/package.json +24 -24
- package/dist/src/tools/deletePanElementOrFolder.js +0 -41
- package/dist/src/tools/postPanElementOrFolder.js +0 -84
- package/dist/src/tools/updatePanElementOrFolder.js +0 -100
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
3
|
export const method = 'deleteWorkspace';
|
|
4
|
-
export const description = 'Deletes an existing workspace
|
|
4
|
+
export const description = 'Deletes an existing workspace.';
|
|
5
5
|
export const parameters = z.object({ workspaceId: z.string().describe("The workspace's ID.") });
|
|
6
6
|
export const annotations = {
|
|
7
7
|
title: 'Deletes an existing workspace.',
|
|
@@ -18,8 +18,8 @@ export const parameters = z.object({
|
|
|
18
18
|
.describe('The option for setting the indentation character type.')
|
|
19
19
|
.default('Space'),
|
|
20
20
|
parametersResolution: z
|
|
21
|
-
.
|
|
22
|
-
.describe(
|
|
21
|
+
.string()
|
|
22
|
+
.describe('Generated collections use examples for parameter generation by default. Any existing collections generated using the schema parameter generation will continue to sync using their existing strategy.')
|
|
23
23
|
.default('Schema'),
|
|
24
24
|
folderStrategy: z
|
|
25
25
|
.enum(['Paths', 'Tags'])
|
|
@@ -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
|
+
}
|
|
@@ -46,13 +46,19 @@ First, locate the collection the user wants to work with. Determine whether the
|
|
|
46
46
|
|
|
47
47
|
### For Public APIs
|
|
48
48
|
|
|
49
|
-
Use \`
|
|
49
|
+
Use \`searchPostmanElementsInPublicNetwork\` to find public API collections:
|
|
50
50
|
|
|
51
|
-
- \`
|
|
51
|
+
- \`searchPostmanElementsInPublicNetwork(q, entityType: collections)\` - Search for public collections. E.g. if the user says "find the Stripe API and build a demo" then call this tool with the query "stripe" and entityType "collections". Review the collection(s) returned and select the best match. If multiple collections look viable, ask the user which one to use.
|
|
52
52
|
|
|
53
|
-
### For
|
|
53
|
+
### For Private APIs in the user's organization
|
|
54
54
|
|
|
55
|
-
Use \`
|
|
55
|
+
Use \`searchPostmanElementsInPrivateNetwork\` to find API collections in the Private API Network which is a central repository of trusted Workspaces within the organisation meant for discovery and reuse :
|
|
56
|
+
|
|
57
|
+
- \`searchPostmanElementsInPrivateNetwork(q, entityType: collections)\` - Search for API collections in the Private API Network. E.g. if the user says "find the notification API and integrate it" then call this tool with the query "notification" and entityType "collections". Review the collection(s) returned and select the best match. If multiple API requests look viable, ask the user which one to use.
|
|
58
|
+
|
|
59
|
+
### For user owned APIs
|
|
60
|
+
|
|
61
|
+
Use \`getWorkspaces\` and \`getWorkspace\` to find user's internal API collections:
|
|
56
62
|
|
|
57
63
|
- \`getWorkspaces()\` - Fetch all workspaces the user has access to. Look for a workspace with a name that matches what the user is looking for.
|
|
58
64
|
|
|
@@ -64,7 +70,7 @@ Once you've identified the target collection (from either path above):
|
|
|
64
70
|
|
|
65
71
|
- \`getCollection(collectionId)\` - Fetch the collection details by passing its uid. IMPORTANT: Do NOT pass model=minimal or model=full, omit the model parameter entirely. The response will include collection-level documentation and a recursive itemRefs array with the names and uids of all folders and requests.
|
|
66
72
|
|
|
67
|
-
**IMPORTANT:** Once you have established the collection, do NOT call
|
|
73
|
+
**IMPORTANT:** Once you have established the collection, do NOT call searchPostmanElementsInPublicNetwork or searchPostmanElementsInPrivateNetwork or getWorkspaces again to find requests. Use getCollectionRequest to explore individual requests within the collection.
|
|
68
74
|
|
|
69
75
|
## 1.2 Explore Requests and Plan
|
|
70
76
|
|
|
@@ -90,7 +96,7 @@ Once you know which requests need code generated, gather all remaining context t
|
|
|
90
96
|
|
|
91
97
|
- \`getCollectionResponse(responseId, collectionId, uid: true, populate: false)\` - Call this for response example uids returned from getCollectionRequest. Use the information for: creating response types in typed languages, adding response schema comments in untyped languages, and understanding both success and error cases.
|
|
92
98
|
|
|
93
|
-
- \`getEnvironments(workspaceId)\` - Fetch all environments for the workspace that the collection belongs to (the workspaceId was returned from
|
|
99
|
+
- \`getEnvironments(workspaceId)\` - Fetch all environments for the workspace that the collection belongs to (the workspaceId was returned from searchPostmanElementsInPublicNetwork or searchPostmanElementsInPrivateNetwork). ALWAYS pass a workspaceId. If you do not have a workspaceId, do NOT call this tool.
|
|
94
100
|
|
|
95
101
|
- \`getEnvironment(environmentId)\` - For each environment, fetch the full details to see what variables have been defined and retrieve their values.
|
|
96
102
|
|
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { asMcpError, McpError } from '../utils/toolHelpers.js';
|
|
3
3
|
export const method = 'getCollectionMap';
|
|
4
4
|
export const description = `Get a Postman collection map with metadata and a complete recursive index of all folders and requests. Response includes collection metadata and description. Response includes itemRefs property (name and id only) instead of the full item array. After calling, present the collection summary and ask the user where they\'d like to explore next, calling getCollectionFolder and/or getCollectionRequest tools in parallel to get more data quickly.
|
|
5
|
-
Once you've called this tool, DO NOT call
|
|
6
|
-
Only use
|
|
5
|
+
Once you've called this tool, DO NOT call searchPostmanElementsInPublicNetwork to find items in or related to this collection. Instead, use the map in itemRefs.
|
|
6
|
+
Only use searchPostmanElementsInPublicNetwork to find the collection where a request may be. Then, stay in the collection and don't use the search.
|
|
7
7
|
When using the getCollectionRequest tool to look up request data, omit the populate parameter to avoid getting all response examples
|
|
8
8
|
back at once (can be very large). Instead, use the response ids from the return value and call getCollectionResponse for each one.
|
|
9
9
|
Prepend the collection's ownerId to the front of each response id when passing it to getCollectionResponse. This is the first part of the collection uid.
|
|
@@ -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,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
3
|
export const method = 'pullCollectionChanges';
|
|
4
4
|
export const description = "Pulls the changes from a parent (source) collection into the forked collection. In the endpoint's response:\n\n- The \\`destinationId\\` is the ID of the forked collection.\n- The \\`sourceId\\` is the ID of the source collection.\n";
|
|
5
|
-
export const parameters = z.object({
|
|
5
|
+
export const parameters = z.object({
|
|
6
|
+
collectionId: z.string().describe("The forked collection's ID."),
|
|
7
|
+
});
|
|
6
8
|
export const annotations = {
|
|
7
9
|
title: "Pulls the changes from a parent (source) collection into the forked collection. In the endpoint's response:",
|
|
8
10
|
readOnlyHint: false,
|
|
@@ -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()
|
|
@@ -545,6 +545,16 @@ export const parameters = z.object({
|
|
|
545
545
|
})
|
|
546
546
|
.describe('The [settings](https://learning.postman.com/docs/sending-requests/create-requests/request-settings/) used to alter the [Protocol Profile Behavior](https://github.com/postmanlabs/postman-runtime/blob/develop/docs/protocol-profile-behavior.md) of sending a request.')
|
|
547
547
|
.optional(),
|
|
548
|
+
createdAt: z
|
|
549
|
+
.string()
|
|
550
|
+
.datetime({ offset: true })
|
|
551
|
+
.describe('The date and time at which the collection item was created.')
|
|
552
|
+
.optional(),
|
|
553
|
+
updatedAt: z
|
|
554
|
+
.string()
|
|
555
|
+
.datetime({ offset: true })
|
|
556
|
+
.describe('The date and time at which the collection item was updated.')
|
|
557
|
+
.optional(),
|
|
548
558
|
uid: z.string().describe("The collection item's unique ID.").optional(),
|
|
549
559
|
})
|
|
550
560
|
.describe('Information about the collection request or folder.')),
|
|
@@ -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
|
+
}
|