@postman/postman-mcp-server 2.6.1 → 2.7.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/README.md +236 -80
- package/dist/package.json +11 -10
- package/dist/src/enabledResources.js +9 -3
- package/dist/src/index.js +11 -0
- package/dist/src/tools/createCollection.js +1 -1
- package/dist/src/tools/createCollectionComment.js +1 -1
- package/dist/src/tools/createCollectionFolder.js +1 -1
- package/dist/src/tools/createCollectionRequest.js +257 -93
- package/dist/src/tools/createCollectionResponse.js +415 -4
- package/dist/src/tools/createEnvironment.js +1 -1
- package/dist/src/tools/createFolderComment.js +1 -1
- package/dist/src/tools/createMock.js +1 -1
- package/dist/src/tools/createMonitor.js +1 -1
- package/dist/src/tools/createRequestComment.js +1 -1
- package/dist/src/tools/createResponseComment.js +1 -1
- package/dist/src/tools/createSpec.js +17 -5
- package/dist/src/tools/createSpecFile.js +1 -1
- package/dist/src/tools/createWorkspace.js +6 -2
- package/dist/src/tools/deleteApiCollectionComment.js +1 -1
- package/dist/src/tools/deleteCollectionComment.js +1 -1
- package/dist/src/tools/deleteFolderComment.js +1 -1
- package/dist/src/tools/deleteMock.js +1 -1
- package/dist/src/tools/deletePanElementOrFolder.js +1 -1
- package/dist/src/tools/deleteRequestComment.js +1 -1
- package/dist/src/tools/deleteResponseComment.js +1 -1
- package/dist/src/tools/deleteWorkspace.js +1 -1
- package/dist/src/tools/duplicateCollection.js +1 -1
- package/dist/src/tools/generateCollection.js +3 -3
- package/dist/src/tools/getAllElementsAndFolders.js +1 -1
- package/dist/src/tools/getAuthenticatedUser.js +1 -1
- package/dist/src/tools/getCodeGenerationInstructions.js +17 -11
- package/dist/src/tools/getCollection/getCollectionMap.js +2 -2
- package/dist/src/tools/getMock.js +1 -1
- package/dist/src/tools/getMocks.js +1 -1
- package/dist/src/tools/getSourceCollectionStatus.js +1 -1
- package/dist/src/tools/getTaggedEntities.js +1 -1
- package/dist/src/tools/getWorkspace.js +1 -1
- package/dist/src/tools/getWorkspaces.js +1 -1
- package/dist/src/tools/mergeCollectionFork.js +1 -1
- package/dist/src/tools/patchCollection.js +1 -1
- package/dist/src/tools/patchEnvironment.js +1 -1
- package/dist/src/tools/postPanElementOrFolder.js +1 -1
- package/dist/src/tools/publishDocumentation.js +1 -1
- package/dist/src/tools/pullCollectionChanges.js +4 -2
- package/dist/src/tools/putCollection.js +11 -1
- package/dist/src/tools/putEnvironment.js +1 -1
- package/dist/src/tools/resolveCommentThread.js +1 -1
- package/dist/src/tools/runMonitor.js +1 -1
- package/dist/src/tools/searchPostmanElementsInPrivateNetwork.js +127 -0
- package/dist/src/tools/searchPostmanElementsInPublicNetwork.js +101 -0
- package/dist/src/tools/syncCollectionWithSpec.js +1 -1
- package/dist/src/tools/syncSpecWithCollection.js +1 -1
- package/dist/src/tools/updateApiCollectionComment.js +1 -1
- package/dist/src/tools/updateCollectionComment.js +1 -1
- package/dist/src/tools/updateCollectionFolder.js +1 -1
- package/dist/src/tools/updateCollectionRequest.js +259 -96
- package/dist/src/tools/updateCollectionResponse.js +1 -1
- package/dist/src/tools/updateFolderComment.js +1 -1
- package/dist/src/tools/updateMock.js +1 -1
- package/dist/src/tools/updatePanElementOrFolder.js +1 -1
- package/dist/src/tools/updateRequestComment.js +1 -1
- package/dist/src/tools/updateResponseComment.js +1 -1
- package/dist/src/tools/updateSpecFile.js +1 -1
- package/dist/src/tools/updateWorkspace.js +1 -1
- package/dist/src/tools/utils/templateRenderer.js +23 -0
- package/dist/src/views/getCollections.njk +12 -0
- package/dist/src/views/getWorkspaces.njk +6 -0
- package/package.json +11 -10
- package/dist/src/tools/searchPostmanElements.js +0 -69
|
@@ -9,7 +9,7 @@ export const parameters = z.object({
|
|
|
9
9
|
elementType: z.enum(['api', 'folder', 'collection', 'workspace']).describe('The element type.'),
|
|
10
10
|
});
|
|
11
11
|
export const annotations = {
|
|
12
|
-
title: "Removes an element or delete a folder from your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/)
|
|
12
|
+
title: "Removes an element or delete a folder from your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).",
|
|
13
13
|
readOnlyHint: false,
|
|
14
14
|
destructiveHint: true,
|
|
15
15
|
idempotentHint: true,
|
|
@@ -8,7 +8,7 @@ export const parameters = z.object({
|
|
|
8
8
|
commentId: z.number().int().describe("The comment's ID."),
|
|
9
9
|
});
|
|
10
10
|
export const annotations = {
|
|
11
|
-
title: 'Deletes a comment from a request. On success, this returns an HTTP \\`204 No Content\\` response
|
|
11
|
+
title: 'Deletes a comment from a request. On success, this returns an HTTP \\`204 No Content\\` response.',
|
|
12
12
|
readOnlyHint: false,
|
|
13
13
|
destructiveHint: true,
|
|
14
14
|
idempotentHint: true,
|
|
@@ -8,7 +8,7 @@ export const parameters = z.object({
|
|
|
8
8
|
commentId: z.number().int().describe("The comment's ID."),
|
|
9
9
|
});
|
|
10
10
|
export const annotations = {
|
|
11
|
-
title: 'Deletes a comment from a response. On success, this returns an HTTP \\`204 No Content\\` response
|
|
11
|
+
title: 'Deletes a comment from a response. On success, this returns an HTTP \\`204 No Content\\` response.',
|
|
12
12
|
readOnlyHint: false,
|
|
13
13
|
destructiveHint: true,
|
|
14
14
|
idempotentHint: true,
|
|
@@ -4,7 +4,7 @@ export const method = 'deleteWorkspace';
|
|
|
4
4
|
export const description = 'Deletes an existing workspace.\n\n### Important\n\nIf you delete a workspace that has a linked collection or environment with another workspace, this will delete the collection and environment in all workspaces.\n';
|
|
5
5
|
export const parameters = z.object({ workspaceId: z.string().describe("The workspace's ID.") });
|
|
6
6
|
export const annotations = {
|
|
7
|
-
title: 'Deletes an existing workspace
|
|
7
|
+
title: 'Deletes an existing workspace.',
|
|
8
8
|
readOnlyHint: false,
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
idempotentHint: true,
|
|
@@ -12,7 +12,7 @@ export const parameters = z.object({
|
|
|
12
12
|
.optional(),
|
|
13
13
|
});
|
|
14
14
|
export const annotations = {
|
|
15
|
-
title:
|
|
15
|
+
title: 'Creates a duplicate of the given collection in another workspace.',
|
|
16
16
|
readOnlyHint: false,
|
|
17
17
|
destructiveHint: false,
|
|
18
18
|
idempotentHint: false,
|
|
@@ -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'])
|
|
@@ -54,7 +54,7 @@ export const parameters = z.object({
|
|
|
54
54
|
.default({ enableOptionalParameters: true, folderStrategy: 'Paths' }),
|
|
55
55
|
});
|
|
56
56
|
export const annotations = {
|
|
57
|
-
title: 'Creates a collection from the given API specification
|
|
57
|
+
title: 'Creates a collection from the given API specification.',
|
|
58
58
|
readOnlyHint: false,
|
|
59
59
|
destructiveHint: false,
|
|
60
60
|
idempotentHint: false,
|
|
@@ -64,7 +64,7 @@ export const parameters = z.object({
|
|
|
64
64
|
.optional(),
|
|
65
65
|
});
|
|
66
66
|
export const annotations = {
|
|
67
|
-
title: "Gets information about the folders and their elements added to your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/)
|
|
67
|
+
title: "Gets information about the folders and their elements added to your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).",
|
|
68
68
|
readOnlyHint: true,
|
|
69
69
|
destructiveHint: false,
|
|
70
70
|
idempotentHint: true,
|
|
@@ -4,7 +4,7 @@ export const method = 'getAuthenticatedUser';
|
|
|
4
4
|
export const description = 'Gets information about the authenticated user.\n- This endpoint provides “current user” context (\\`user.id\\`, \\`username\\`, \\`teamId\\`, roles).\n- When a user asks for “my …” (e.g., “my workspaces, my information, etc.”), call this first to resolve the user ID.\n';
|
|
5
5
|
export const parameters = z.object({});
|
|
6
6
|
export const annotations = {
|
|
7
|
-
title: 'Gets information about the authenticated user
|
|
7
|
+
title: 'Gets information about the authenticated user.',
|
|
8
8
|
readOnlyHint: true,
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
idempotentHint: true,
|
|
@@ -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
|
|
|
@@ -250,10 +256,10 @@ JavaScript/TypeScript:
|
|
|
250
256
|
\`\`\`javascript
|
|
251
257
|
/**
|
|
252
258
|
* Generated by Postman Code
|
|
253
|
-
*
|
|
259
|
+
*
|
|
254
260
|
* Collection: Stripe API
|
|
255
261
|
* Collection UID: 12345678-1234-1234-1234-123456789abc
|
|
256
|
-
*
|
|
262
|
+
*
|
|
257
263
|
* Request: Payment Intents > Create Payment Intent
|
|
258
264
|
* Request UID: 87654321-4321-4321-4321-cba987654321
|
|
259
265
|
* Request modified at: 2024-11-10T15:45:30.000Z
|
|
@@ -337,15 +343,15 @@ switch (response.status) {
|
|
|
337
343
|
case 404:
|
|
338
344
|
console.error('Resource not found');
|
|
339
345
|
throw new NotFoundError(await response.json());
|
|
340
|
-
|
|
346
|
+
|
|
341
347
|
case 401:
|
|
342
348
|
console.error('Authentication failed');
|
|
343
349
|
throw new UnauthorizedError(await response.json());
|
|
344
|
-
|
|
350
|
+
|
|
345
351
|
case 422:
|
|
346
352
|
console.error('Validation failed');
|
|
347
353
|
throw new ValidationError(await response.json());
|
|
348
|
-
|
|
354
|
+
|
|
349
355
|
default:
|
|
350
356
|
console.error('Unexpected error');
|
|
351
357
|
throw new Error(await response.text());
|
|
@@ -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.
|
|
@@ -4,7 +4,7 @@ export const method = 'getMock';
|
|
|
4
4
|
export const description = 'Gets information about a mock server.\n- Resource: Mock server entity. Response includes the associated \\`collection\\` UID and \\`mockUrl\\`.\n- Use the \\`collection\\` UID to navigate back to the source collection.\n';
|
|
5
5
|
export const parameters = z.object({ mockId: z.string().describe("The mock's ID.") });
|
|
6
6
|
export const annotations = {
|
|
7
|
-
title: 'Gets information about a mock server
|
|
7
|
+
title: 'Gets information about a mock server.',
|
|
8
8
|
readOnlyHint: true,
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
idempotentHint: true,
|
|
@@ -13,7 +13,7 @@ export const parameters = z.object({
|
|
|
13
13
|
.optional(),
|
|
14
14
|
});
|
|
15
15
|
export const annotations = {
|
|
16
|
-
title: 'Gets all active mock servers. By default, returns only mock servers you created across all workspaces
|
|
16
|
+
title: 'Gets all active mock servers. By default, returns only mock servers you created across all workspaces.',
|
|
17
17
|
readOnlyHint: true,
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
idempotentHint: true,
|
|
@@ -4,7 +4,7 @@ export const method = 'getSourceCollectionStatus';
|
|
|
4
4
|
export const description = 'Checks whether there is a change between the forked collection and its parent (source) collection.\n\nIf the value of the \\`isSourceAhead\\` property is \\`true\\` in the response, then there is a difference between the forked collection and its source collection.\n\n**Note:**\n\nThis endpoint may take a few minutes to return an updated \\`isSourceAhead\\` status.\n';
|
|
5
5
|
export const parameters = z.object({ collectionId: z.string().describe("The collection's ID.") });
|
|
6
6
|
export const annotations = {
|
|
7
|
-
title: 'Checks whether there is a change between the forked collection and its parent (source) collection
|
|
7
|
+
title: 'Checks whether there is a change between the forked collection and its parent (source) collection.',
|
|
8
8
|
readOnlyHint: true,
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
idempotentHint: true,
|
|
@@ -29,7 +29,7 @@ export const parameters = z.object({
|
|
|
29
29
|
.optional(),
|
|
30
30
|
});
|
|
31
31
|
export const annotations = {
|
|
32
|
-
title: 'Gets Postman elements (entities) by a given tag. Tags enable you to organize and search [workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#tagging-a-workspace), [APIs](https://learning.postman.com/docs/designing-and-developing-your-api/managing-apis/#tagging-apis), and [collections](https://learning.postman.com/docs/collections/using-collections/#tagging-a-collection) that contain shared tags
|
|
32
|
+
title: 'Gets Postman elements (entities) by a given tag. Tags enable you to organize and search [workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#tagging-a-workspace), [APIs](https://learning.postman.com/docs/designing-and-developing-your-api/managing-apis/#tagging-apis), and [collections](https://learning.postman.com/docs/collections/using-collections/#tagging-a-collection) that contain shared tags.',
|
|
33
33
|
readOnlyHint: true,
|
|
34
34
|
destructiveHint: false,
|
|
35
35
|
idempotentHint: true,
|
|
@@ -10,7 +10,7 @@ export const parameters = z.object({
|
|
|
10
10
|
.optional(),
|
|
11
11
|
});
|
|
12
12
|
export const annotations = {
|
|
13
|
-
title:
|
|
13
|
+
title: 'Gets information about a workspace.',
|
|
14
14
|
readOnlyHint: true,
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
idempotentHint: true,
|
|
@@ -18,7 +18,7 @@ export const parameters = z.object({
|
|
|
18
18
|
.optional(),
|
|
19
19
|
});
|
|
20
20
|
export const annotations = {
|
|
21
|
-
title:
|
|
21
|
+
title: 'Gets all workspaces you have access to.',
|
|
22
22
|
readOnlyHint: true,
|
|
23
23
|
destructiveHint: false,
|
|
24
24
|
idempotentHint: true,
|
|
@@ -12,7 +12,7 @@ export const parameters = z.object({
|
|
|
12
12
|
.default('updateSourceWithDestination'),
|
|
13
13
|
});
|
|
14
14
|
export const annotations = {
|
|
15
|
-
title: '**This endpoint is deprecated
|
|
15
|
+
title: '**This endpoint is deprecated.**',
|
|
16
16
|
readOnlyHint: false,
|
|
17
17
|
destructiveHint: false,
|
|
18
18
|
idempotentHint: false,
|
|
@@ -279,7 +279,7 @@ export const parameters = z.object({
|
|
|
279
279
|
.optional(),
|
|
280
280
|
});
|
|
281
281
|
export const annotations = {
|
|
282
|
-
title: 'Updates specific collection information, such as its name, events, or its variables. For more information, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html)
|
|
282
|
+
title: 'Updates specific collection information, such as its name, events, or its variables. For more information, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
|
|
283
283
|
readOnlyHint: false,
|
|
284
284
|
destructiveHint: false,
|
|
285
285
|
idempotentHint: true,
|
|
@@ -47,7 +47,7 @@ export const parameters = z.object({
|
|
|
47
47
|
]),
|
|
48
48
|
});
|
|
49
49
|
export const annotations = {
|
|
50
|
-
title: 'Updates specific environment properties, such as its name and variables
|
|
50
|
+
title: 'Updates specific environment properties, such as its name and variables.',
|
|
51
51
|
readOnlyHint: false,
|
|
52
52
|
destructiveHint: false,
|
|
53
53
|
idempotentHint: true,
|
|
@@ -49,7 +49,7 @@ export const parameters = z.object({
|
|
|
49
49
|
]),
|
|
50
50
|
});
|
|
51
51
|
export const annotations = {
|
|
52
|
-
title: "Publishes a element or creates a folder in your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/). An element is a Postman API, collection, or workspace
|
|
52
|
+
title: "Publishes a element or creates a folder in your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/). An element is a Postman API, collection, or workspace.",
|
|
53
53
|
readOnlyHint: false,
|
|
54
54
|
destructiveHint: false,
|
|
55
55
|
idempotentHint: false,
|
|
@@ -81,7 +81,7 @@ export const parameters = z.object({
|
|
|
81
81
|
.describe("Information about the documentation's customization."),
|
|
82
82
|
});
|
|
83
83
|
export const annotations = {
|
|
84
|
-
title: "Publishes a collection's documentation. This makes it publicly available to anyone with the link to the documentation
|
|
84
|
+
title: "Publishes a collection's documentation. This makes it publicly available to anyone with the link to the documentation.",
|
|
85
85
|
readOnlyHint: false,
|
|
86
86
|
destructiveHint: false,
|
|
87
87
|
idempotentHint: true,
|
|
@@ -2,9 +2,11 @@ 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
|
-
title: "Pulls the changes from a parent (source) collection into the forked collection. In the endpoint's response
|
|
9
|
+
title: "Pulls the changes from a parent (source) collection into the forked collection. In the endpoint's response:",
|
|
8
10
|
readOnlyHint: false,
|
|
9
11
|
destructiveHint: false,
|
|
10
12
|
idempotentHint: true,
|
|
@@ -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.')),
|
|
@@ -877,7 +887,7 @@ export const parameters = z.object({
|
|
|
877
887
|
.optional(),
|
|
878
888
|
});
|
|
879
889
|
export const annotations = {
|
|
880
|
-
title: "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
|
|
890
|
+
title: "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.",
|
|
881
891
|
readOnlyHint: false,
|
|
882
892
|
destructiveHint: false,
|
|
883
893
|
idempotentHint: true,
|
|
@@ -28,7 +28,7 @@ export const parameters = z.object({
|
|
|
28
28
|
.optional(),
|
|
29
29
|
});
|
|
30
30
|
export const annotations = {
|
|
31
|
-
title: 'Replaces all the contents of an environment with the given information
|
|
31
|
+
title: 'Replaces all the contents of an environment with the given information.',
|
|
32
32
|
readOnlyHint: false,
|
|
33
33
|
destructiveHint: false,
|
|
34
34
|
idempotentHint: true,
|
|
@@ -6,7 +6,7 @@ export const parameters = z.object({
|
|
|
6
6
|
threadId: z.number().int().describe("The comment's thread ID."),
|
|
7
7
|
});
|
|
8
8
|
export const annotations = {
|
|
9
|
-
title: 'Resolves a comment and any associated replies. On success, this returns an HTTP \\`204 No Content\\` response
|
|
9
|
+
title: 'Resolves a comment and any associated replies. On success, this returns an HTTP \\`204 No Content\\` response.',
|
|
10
10
|
readOnlyHint: false,
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
idempotentHint: false,
|
|
@@ -10,7 +10,7 @@ export const parameters = z.object({
|
|
|
10
10
|
.default(false),
|
|
11
11
|
});
|
|
12
12
|
export const annotations = {
|
|
13
|
-
title:
|
|
13
|
+
title: 'Runs a monitor and returns its run results.',
|
|
14
14
|
readOnlyHint: false,
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
idempotentHint: false,
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ContentType } from '../clients/postman.js';
|
|
3
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
|
+
export const method = 'searchPostmanElementsInPrivateNetwork';
|
|
5
|
+
export const description = `Search for API requests and collections in your organization's Private API Network—a curated repository of trusted, internal APIs shared by your team.
|
|
6
|
+
|
|
7
|
+
**What is the Private API Network?**
|
|
8
|
+
The Private API Network is where your organization stores vetted APIs for internal use. These are trusted team workspaces containing approved microservices, internal tools, and shared API collections.
|
|
9
|
+
|
|
10
|
+
**When to Use This Tool:**
|
|
11
|
+
- Finding internal/company trusted APIs (e.g., "find a trusted api for notification service", "find our payment APIs", "search for internal microservices")
|
|
12
|
+
- Discovering trusted APIs shared within your organization
|
|
13
|
+
- Looking up team-approved API collections and requests
|
|
14
|
+
- When the user wants to find collections in the private network (e.g., "find internal access control collections", "search for payment API collections in our network")
|
|
15
|
+
|
|
16
|
+
**Search Scope:**
|
|
17
|
+
- Searches only trusted internal APIs in the Private API Network
|
|
18
|
+
- Returns requests or collections from team workspaces published to the network
|
|
19
|
+
|
|
20
|
+
**Entity Types:**
|
|
21
|
+
- \`requests\`: Search for individual API requests (default)
|
|
22
|
+
- \`collections\`: Search for collections (unique collections extracted from request results; pagination applies to underlying requests)`;
|
|
23
|
+
export const parameters = z.object({
|
|
24
|
+
entityType: z
|
|
25
|
+
.enum(['requests', 'collections'])
|
|
26
|
+
.describe('The type of Postman element to search for. Use `requests` to search for individual API requests, or `collections` to search for collections (unique collections extracted from request results; pagination applies to underlying requests).')
|
|
27
|
+
.default('requests'),
|
|
28
|
+
q: z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(512)
|
|
32
|
+
.describe('The search query for API elements in the Private API Network (e.g. "invoices API", "notification service", "payment APIs").'),
|
|
33
|
+
nextCursor: z
|
|
34
|
+
.string()
|
|
35
|
+
.describe('The cursor to get the next set of results in the paginated response. If you pass an invalid value, the API returns empty results.')
|
|
36
|
+
.optional(),
|
|
37
|
+
limit: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.gte(1)
|
|
41
|
+
.lte(10)
|
|
42
|
+
.describe('The max number of search results returned in the response.')
|
|
43
|
+
.default(10)
|
|
44
|
+
.optional(),
|
|
45
|
+
});
|
|
46
|
+
export const annotations = {
|
|
47
|
+
title: "Search for API requests and collections in your organization's Private API Network—a curated repository of trusted, internal APIs shared by your team.",
|
|
48
|
+
readOnlyHint: true,
|
|
49
|
+
destructiveHint: false,
|
|
50
|
+
idempotentHint: true,
|
|
51
|
+
};
|
|
52
|
+
const PRIVATE_NETWORK_FILTER = {
|
|
53
|
+
$and: [
|
|
54
|
+
{
|
|
55
|
+
privateNetwork: {
|
|
56
|
+
$eq: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
export async function handler(args, extra) {
|
|
62
|
+
try {
|
|
63
|
+
const query = new URLSearchParams();
|
|
64
|
+
if (args.limit !== undefined)
|
|
65
|
+
query.set('limit', String(args.limit));
|
|
66
|
+
if (args.nextCursor !== undefined)
|
|
67
|
+
query.set('nextCursor', String(args.nextCursor));
|
|
68
|
+
const endpoint = query.toString() ? `/search?${query.toString()}` : '/search';
|
|
69
|
+
const body = {
|
|
70
|
+
q: args.q,
|
|
71
|
+
elementType: 'requests',
|
|
72
|
+
filters: PRIVATE_NETWORK_FILTER,
|
|
73
|
+
};
|
|
74
|
+
const options = {
|
|
75
|
+
body: JSON.stringify(body),
|
|
76
|
+
contentType: ContentType.Json,
|
|
77
|
+
headers: extra.headers,
|
|
78
|
+
};
|
|
79
|
+
const result = await extra.client.post(endpoint, options);
|
|
80
|
+
if (args.entityType === 'collections') {
|
|
81
|
+
const collectionsMap = new Map();
|
|
82
|
+
const data = result?.data || [];
|
|
83
|
+
for (const item of data) {
|
|
84
|
+
if (item.collection && !collectionsMap.has(item.collection.id)) {
|
|
85
|
+
collectionsMap.set(item.collection.id, {
|
|
86
|
+
collectionId: item.collection.id,
|
|
87
|
+
collectionName: item.collection.name,
|
|
88
|
+
workspaceId: item.workspace?.id,
|
|
89
|
+
workspaceName: item.workspace?.name,
|
|
90
|
+
publisher: item.publisher?.name,
|
|
91
|
+
publisherVerified: item.publisher?.isVerified,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const collections = Array.from(collectionsMap.values());
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{
|
|
99
|
+
type: 'text',
|
|
100
|
+
text: JSON.stringify({
|
|
101
|
+
data: collections,
|
|
102
|
+
meta: {
|
|
103
|
+
nextCursor: result?.meta?.nextCursor,
|
|
104
|
+
collectionsCount: collections.length,
|
|
105
|
+
note: 'Collections extracted from request results. Pagination applies to underlying requests.',
|
|
106
|
+
},
|
|
107
|
+
}, null, 2),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
if (e instanceof McpError) {
|
|
123
|
+
throw e;
|
|
124
|
+
}
|
|
125
|
+
throw asMcpError(e);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
+
export const method = 'searchPostmanElementsInPublicNetwork';
|
|
4
|
+
export const description = 'Searches for Postman elements in the public network.\n\n**When to Use This Tool:**\n- When the user asks for a specific named request (e.g., "find PayPal requests", "search for Stripe API requests")\n- When the user wants to find collections (e.g., "find Stripe collections", "search for payment API collections")\n- When the user explicitly wants to search the public network\n- Do NOT use this for searching the user\'s own workspaces or collections (use getCollections or getWorkspaces instead)\n\n**Search Scope:**\n- Only searches the public network (public workspaces and collections)\n- Does not search private workspaces, team workspaces, or personal collections\n\n**Entity Types:**\n- `requests`: Search for individual API requests\n- `collections`: Search for collections (unique collections extracted from request results; pagination applies to underlying requests)\n';
|
|
5
|
+
export const parameters = z.object({
|
|
6
|
+
entityType: z
|
|
7
|
+
.enum(['requests', 'collections'])
|
|
8
|
+
.describe('The type of Postman [entity](https://learning.postman.com/docs/getting-started/basics/postman-elements/) to search for. Use `requests` to search for individual API requests, or `collections` to search for collections (unique collections extracted from request results; pagination applies to underlying requests).'),
|
|
9
|
+
q: z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(512)
|
|
13
|
+
.describe('The query used to search for Postman elements.')
|
|
14
|
+
.optional(),
|
|
15
|
+
publisherIsVerified: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.describe('Filter the search results to only return entities from publishers [verified](https://learning.postman.com/docs/collaborating-in-postman/public-api-network/verify-your-team/) by Postman.')
|
|
18
|
+
.optional(),
|
|
19
|
+
nextCursor: z
|
|
20
|
+
.string()
|
|
21
|
+
.describe('The cursor to get the next set of results in the paginated response. If you pass an invalid value, the API returns empty results.')
|
|
22
|
+
.optional(),
|
|
23
|
+
limit: z
|
|
24
|
+
.number()
|
|
25
|
+
.int()
|
|
26
|
+
.gte(1)
|
|
27
|
+
.lte(10)
|
|
28
|
+
.describe('The max number of search results returned in the response.')
|
|
29
|
+
.default(10),
|
|
30
|
+
});
|
|
31
|
+
export const annotations = {
|
|
32
|
+
title: 'Searches for Postman elements in the public network.',
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
destructiveHint: false,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
};
|
|
37
|
+
export async function handler(args, extra) {
|
|
38
|
+
try {
|
|
39
|
+
const endpoint = '/search/requests';
|
|
40
|
+
const query = new URLSearchParams();
|
|
41
|
+
if (args.q !== undefined)
|
|
42
|
+
query.set('q', String(args.q));
|
|
43
|
+
if (args.publisherIsVerified !== undefined)
|
|
44
|
+
query.set('publisherIsVerified', String(args.publisherIsVerified));
|
|
45
|
+
if (args.nextCursor !== undefined)
|
|
46
|
+
query.set('nextCursor', String(args.nextCursor));
|
|
47
|
+
if (args.limit !== undefined)
|
|
48
|
+
query.set('limit', String(args.limit));
|
|
49
|
+
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
50
|
+
const options = {
|
|
51
|
+
headers: extra.headers,
|
|
52
|
+
};
|
|
53
|
+
const result = await extra.client.get(url, options);
|
|
54
|
+
if (args.entityType === 'collections') {
|
|
55
|
+
const collectionsMap = new Map();
|
|
56
|
+
const data = result?.data || [];
|
|
57
|
+
for (const item of data) {
|
|
58
|
+
if (!collectionsMap.has(item.collection.id)) {
|
|
59
|
+
collectionsMap.set(item.collection.id, {
|
|
60
|
+
collectionId: item.collection.id,
|
|
61
|
+
collectionName: item.collection.name,
|
|
62
|
+
workspaceId: item.workspace.id,
|
|
63
|
+
workspaceName: item.workspace.name,
|
|
64
|
+
publisher: item.publisher.name,
|
|
65
|
+
publisherVerified: item.publisher.isVerified,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const collections = Array.from(collectionsMap.values());
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: JSON.stringify({
|
|
75
|
+
data: collections,
|
|
76
|
+
meta: {
|
|
77
|
+
nextCursor: result?.meta?.nextCursor,
|
|
78
|
+
collectionsCount: collections.length,
|
|
79
|
+
note: 'Collections extracted from request results. Pagination applies to underlying requests.',
|
|
80
|
+
},
|
|
81
|
+
}, null, 2),
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: 'text',
|
|
90
|
+
text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
if (e instanceof McpError) {
|
|
97
|
+
throw e;
|
|
98
|
+
}
|
|
99
|
+
throw asMcpError(e);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -7,7 +7,7 @@ export const parameters = z.object({
|
|
|
7
7
|
specId: z.string().describe("The spec's ID."),
|
|
8
8
|
});
|
|
9
9
|
export const annotations = {
|
|
10
|
-
title: 'Syncs a collection generated from an API specification. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response
|
|
10
|
+
title: 'Syncs a collection generated from an API specification. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response.',
|
|
11
11
|
readOnlyHint: false,
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
idempotentHint: true,
|