@postman/postman-mcp-server 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +204 -80
  2. package/dist/package.json +2 -1
  3. package/dist/src/enabledResources.js +3 -0
  4. package/dist/src/index.js +11 -0
  5. package/dist/src/tools/createCollection.js +1 -1
  6. package/dist/src/tools/createCollectionComment.js +1 -1
  7. package/dist/src/tools/createCollectionFolder.js +1 -1
  8. package/dist/src/tools/createCollectionRequest.js +1 -1
  9. package/dist/src/tools/createCollectionResponse.js +1 -1
  10. package/dist/src/tools/createEnvironment.js +1 -1
  11. package/dist/src/tools/createFolderComment.js +1 -1
  12. package/dist/src/tools/createMock.js +1 -1
  13. package/dist/src/tools/createMonitor.js +1 -1
  14. package/dist/src/tools/createRequestComment.js +1 -1
  15. package/dist/src/tools/createResponseComment.js +1 -1
  16. package/dist/src/tools/createSpec.js +1 -1
  17. package/dist/src/tools/createSpecFile.js +1 -1
  18. package/dist/src/tools/createWorkspace.js +1 -1
  19. package/dist/src/tools/deleteApiCollectionComment.js +1 -1
  20. package/dist/src/tools/deleteCollectionComment.js +1 -1
  21. package/dist/src/tools/deleteFolderComment.js +1 -1
  22. package/dist/src/tools/deleteMock.js +1 -1
  23. package/dist/src/tools/deletePanElementOrFolder.js +1 -1
  24. package/dist/src/tools/deleteRequestComment.js +1 -1
  25. package/dist/src/tools/deleteResponseComment.js +1 -1
  26. package/dist/src/tools/deleteWorkspace.js +1 -1
  27. package/dist/src/tools/duplicateCollection.js +1 -1
  28. package/dist/src/tools/generateCollection.js +1 -1
  29. package/dist/src/tools/getAllElementsAndFolders.js +1 -1
  30. package/dist/src/tools/getAuthenticatedUser.js +1 -1
  31. package/dist/src/tools/getCodeGenerationInstructions.js +6 -6
  32. package/dist/src/tools/getMock.js +1 -1
  33. package/dist/src/tools/getMocks.js +1 -1
  34. package/dist/src/tools/getSourceCollectionStatus.js +1 -1
  35. package/dist/src/tools/getTaggedEntities.js +1 -1
  36. package/dist/src/tools/getWorkspace.js +1 -1
  37. package/dist/src/tools/getWorkspaces.js +1 -1
  38. package/dist/src/tools/mergeCollectionFork.js +1 -1
  39. package/dist/src/tools/patchCollection.js +1 -1
  40. package/dist/src/tools/patchEnvironment.js +1 -1
  41. package/dist/src/tools/postPanElementOrFolder.js +1 -1
  42. package/dist/src/tools/publishDocumentation.js +1 -1
  43. package/dist/src/tools/pullCollectionChanges.js +1 -1
  44. package/dist/src/tools/putCollection.js +1 -1
  45. package/dist/src/tools/putEnvironment.js +1 -1
  46. package/dist/src/tools/resolveCommentThread.js +1 -1
  47. package/dist/src/tools/runMonitor.js +1 -1
  48. package/dist/src/tools/searchPostmanElements.js +38 -6
  49. package/dist/src/tools/syncCollectionWithSpec.js +1 -1
  50. package/dist/src/tools/syncSpecWithCollection.js +1 -1
  51. package/dist/src/tools/updateApiCollectionComment.js +1 -1
  52. package/dist/src/tools/updateCollectionComment.js +1 -1
  53. package/dist/src/tools/updateCollectionFolder.js +1 -1
  54. package/dist/src/tools/updateCollectionRequest.js +1 -1
  55. package/dist/src/tools/updateCollectionResponse.js +1 -1
  56. package/dist/src/tools/updateFolderComment.js +1 -1
  57. package/dist/src/tools/updateMock.js +1 -1
  58. package/dist/src/tools/updatePanElementOrFolder.js +1 -1
  59. package/dist/src/tools/updateRequestComment.js +1 -1
  60. package/dist/src/tools/updateResponseComment.js +1 -1
  61. package/dist/src/tools/updateSpecFile.js +1 -1
  62. package/dist/src/tools/updateWorkspace.js +1 -1
  63. package/dist/src/tools/utils/templateRenderer.js +23 -0
  64. package/dist/src/views/getCollections.njk +12 -0
  65. package/dist/src/views/getWorkspaces.njk +6 -0
  66. package/package.json +2 -1
@@ -21,7 +21,7 @@ export const parameters = z.object({
21
21
  .optional(),
22
22
  });
23
23
  export const annotations = {
24
- title: 'Creates a mock server in a collection.\n\n- Pass the collection UID (ownerId-collectionId), not the bare collection ID.\n- If you only have a \\`collectionId\\`, resolve the UID first:\n 1) Prefer GET \\`/collections/{collectionId}\\` and read \\`uid\\`, or\n 2) Construct \\`{ownerId}-{collectionId}\\` using ownerId from GET \\`/me\\`:\n - For team-owned collections: \\`ownerId = me.teamId\\`\n - For personal collections: \\`ownerId = me.user.id\\`\n- Use the \\`workspace\\` query to place the mock in a specific workspace. Prefer explicit workspace scoping.\n',
24
+ title: 'Creates a mock server in a collection.',
25
25
  readOnlyHint: false,
26
26
  destructiveHint: false,
27
27
  idempotentHint: false,
@@ -112,7 +112,7 @@ export const parameters = z.object({
112
112
  .optional(),
113
113
  });
114
114
  export const annotations = {
115
- title: 'Creates a monitor.\n\n**Note:**\n\n- You cannot create monitors for collections added to an API definition.\n- If you do not pass the \\`workspace\\` query parameter, the system creates the monitor in the oldest personal Internal workspace you own.\n',
115
+ title: 'Creates a monitor.',
116
116
  readOnlyHint: false,
117
117
  destructiveHint: false,
118
118
  idempotentHint: false,
@@ -28,7 +28,7 @@ export const parameters = z.object({
28
28
  .optional(),
29
29
  });
30
30
  export const annotations = {
31
- title: "The request ID must contain the team ID as a prefix, in \\`teamId-requestId\\` format.\n\nFor example, if you're creating a comment on collection ID \\`24585957-7b2c98f7-30db-4b67-8685-0079f48a0947\\` (note on the prefix), and\nthe collection request's ID is \\`2c450b59-9bbf-729b-6ac0-f92535a7c336\\`, then the \\`{requestId}\\` must be \\`24585957-2c450b59-9bbf-729b-6ac0-f92535a7c336\\`.\n",
31
+ title: 'The request ID must contain the team ID as a prefix, in \\`teamId-requestId\\` format.',
32
32
  readOnlyHint: false,
33
33
  destructiveHint: false,
34
34
  idempotentHint: false,
@@ -26,7 +26,7 @@ export const parameters = z.object({
26
26
  .optional(),
27
27
  });
28
28
  export const annotations = {
29
- title: 'Creates a comment on a response. To create a reply on an existing comment, include the \\`threadId\\` property in the request body.\n\n**Note:**\n\nThis endpoint accepts a max of 10,000 characters.\n',
29
+ title: 'Creates a comment on a response. To create a reply on an existing comment, include the \\`threadId\\` property in the request body.',
30
30
  readOnlyHint: false,
31
31
  destructiveHint: false,
32
32
  idempotentHint: false,
@@ -26,7 +26,7 @@ export const parameters = z.object({
26
26
  .describe("A list of the specification's files and their contents."),
27
27
  });
28
28
  export const annotations = {
29
- title: "Creates an API specification in Postman's [Spec Hub](https://learning.postman.com/docs/design-apis/specifications/overview/). Specifications can be single or multi-file.\n\n**Note:**\n- Postman supports OpenAPI 2.0, OpenAPI 3.0, OpenAPI 3.1, and AsyncAPI 2.0 specifications.\n- If the file path contains a \\`/\\` (forward slash) character, then a folder is created. For example, if the path is the \\`components/schemas.json\\` value, then a \\`components\\` folder is created with the \\`schemas.json\\` file inside.\n- Multi-file specifications can only have one root file.\n- Files cannot exceed a maximum of 10 MB in size.\n",
29
+ title: "Creates an API specification in Postman's [Spec Hub](https://learning.postman.com/docs/design-apis/specifications/overview/). Specifications can be single or multi-file.",
30
30
  readOnlyHint: false,
31
31
  destructiveHint: false,
32
32
  idempotentHint: false,
@@ -9,7 +9,7 @@ export const parameters = z.object({
9
9
  content: z.string().describe("The file's stringified contents."),
10
10
  });
11
11
  export const annotations = {
12
- title: 'Creates an API specification file.\n\n**Note:**\n\n- If the file path contains a \\`/\\` (forward slash) character, then a folder is created. For example, if the path is the \\`components/schemas.json\\` value, then a \\`components\\` folder is created with the \\`schemas.json\\` file inside.\n- Creating a spec file assigns it the \\`DEFAULT\\` file type.\n- Multi-file specifications can only have one root file.\n- Files cannot exceed a maximum of 10 MB in size.\n',
12
+ title: 'Creates an API specification file.',
13
13
  readOnlyHint: false,
14
14
  destructiveHint: false,
15
15
  idempotentHint: false,
@@ -17,7 +17,7 @@ export const parameters = z.object({
17
17
  .optional(),
18
18
  });
19
19
  export const annotations = {
20
- title: 'Creates a new [workspace](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/creating-workspaces/).\n\n**Note:**\n\n- This endpoint returns a 403 \\`Forbidden\\` response if the user does not have permission to create workspaces. [Admins and Super Admins](https://learning.postman.com/docs/collaborating-in-postman/roles-and-permissions/#team-roles) can configure workspace permissions to restrict users and/or user groups from creating workspaces or require approvals for the creation of team workspaces.\n- There are rate limits when publishing public workspaces.\n- Public team workspace names must be unique.\n\n### Important\n\nWe deprecated linking collections or environments between workspaces. We do not recommend that you do this.\n\nIf you have a linked collection or environment, note the following:\n- The endpoint does not create a clone of a collection or environment.\n- Any changes you make to a linked collection or environment changes them in all workspaces.\n- If you delete a collection or environment linked between workspaces, the system deletes it in all the workspaces.\n',
20
+ title: 'Creates a new [workspace](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/creating-workspaces/).',
21
21
  readOnlyHint: false,
22
22
  destructiveHint: false,
23
23
  idempotentHint: false,
@@ -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 an API's collection. On success, this returns an HTTP \\`204 No Content\\` response.\n\n**Note:**\n\nDeleting the first comment of a thread deletes all the comments in the thread.\n",
11
+ title: "Deletes a comment from an API's collection. On success, this returns an HTTP \\`204 No Content\\` response.",
12
12
  readOnlyHint: false,
13
13
  destructiveHint: true,
14
14
  idempotentHint: true,
@@ -7,7 +7,7 @@ export const parameters = z.object({
7
7
  commentId: z.number().int().describe("The comment's ID."),
8
8
  });
9
9
  export const annotations = {
10
- title: 'Deletes a comment from a collection. On success, this returns an HTTP \\`204 No Content\\` response.\n\n**Note:**\n\nDeleting the first comment of a thread deletes all the comments in the thread.\n',
10
+ title: 'Deletes a comment from a collection. On success, this returns an HTTP \\`204 No Content\\` response.',
11
11
  readOnlyHint: false,
12
12
  destructiveHint: true,
13
13
  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 folder. On success, this returns an HTTP \\`204 No Content\\` response.\n\n**Note:**\n\nDeleting the first comment of a thread deletes all the comments in the thread.\n',
11
+ title: 'Deletes a comment from a folder. 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 = 'deleteMock';
4
4
  export const description = 'Deletes a mock server.\n- Resource: Mock server entity. This is destructive.\n- Ensure you are targeting the correct mock ID.\n';
5
5
  export const parameters = z.object({ mockId: z.string().describe("The mock's ID.") });
6
6
  export const annotations = {
7
- title: 'Deletes a mock server.\n- Resource: Mock server entity. This is destructive.\n- Ensure you are targeting the correct mock ID.\n',
7
+ title: 'Deletes a mock server.',
8
8
  readOnlyHint: false,
9
9
  destructiveHint: true,
10
10
  idempotentHint: true,
@@ -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/).\n\n**Note:**\n\nRemoving an API, collection, or workspace element does not delete it. It only removes it from the Private API Network folder.\n",
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.\n\n**Note:**\n\nDeleting the first comment of a thread deletes all the comments in the thread.\n',
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.\n\n**Note:**\n\nDeleting the first comment of a thread deletes all the comments in the thread.\n',
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.\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',
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: "Creates a duplicate of the given collection in another workspace.\n\nUse the GET \\`/collection-duplicate-tasks/{taskId}\\` endpoint to get the duplication task's current status.\n",
15
+ title: 'Creates a duplicate of the given collection in another workspace.',
16
16
  readOnlyHint: false,
17
17
  destructiveHint: false,
18
18
  idempotentHint: false,
@@ -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.\nThe specification must already exist or be created before it can be used to generate a collection.\nThe response contains a polling link to the task status.\n',
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/).\n\n**Note:**\n\nThe \\`limit\\` and \\`offset\\` parameters are separately applied to elements and folders. For example, if you query a \\`limit\\` value of \\`10\\` and an \\`offset\\` value \\`0\\`, the endpoint returns 10 elements and 10 folders for a total of 20 items. The \\`totalCount\\` property in the \\`meta\\` response is the total count of both elements and folders.\n",
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.\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',
7
+ title: 'Gets information about the authenticated user.',
8
8
  readOnlyHint: true,
9
9
  destructiveHint: false,
10
10
  idempotentHint: true,
@@ -48,7 +48,7 @@ First, locate the collection the user wants to work with. Determine whether the
48
48
 
49
49
  Use \`searchPostmanElements\` to find public API collections:
50
50
 
51
- - \`searchPostmanElements(q, entityType: requests)\` - Search for public collections by finding requests and extracting the unique collection uids from the response. E.g. if the user says "find the Stripe API and build a demo" then call this tool with the query "stripe" and entityType "requests". Ignore the individual requests returned and extract the collection uids for the collection(s) that appear to be the best match. If multiple collections look viable, ask the user which one to use.
51
+ - \`searchPostmanElements(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
53
  ### For Internal APIs
54
54
 
@@ -250,10 +250,10 @@ JavaScript/TypeScript:
250
250
  \`\`\`javascript
251
251
  /**
252
252
  * Generated by Postman Code
253
- *
253
+ *
254
254
  * Collection: Stripe API
255
255
  * Collection UID: 12345678-1234-1234-1234-123456789abc
256
- *
256
+ *
257
257
  * Request: Payment Intents > Create Payment Intent
258
258
  * Request UID: 87654321-4321-4321-4321-cba987654321
259
259
  * Request modified at: 2024-11-10T15:45:30.000Z
@@ -337,15 +337,15 @@ switch (response.status) {
337
337
  case 404:
338
338
  console.error('Resource not found');
339
339
  throw new NotFoundError(await response.json());
340
-
340
+
341
341
  case 401:
342
342
  console.error('Authentication failed');
343
343
  throw new UnauthorizedError(await response.json());
344
-
344
+
345
345
  case 422:
346
346
  console.error('Validation failed');
347
347
  throw new ValidationError(await response.json());
348
-
348
+
349
349
  default:
350
350
  console.error('Unexpected error');
351
351
  throw new Error(await response.text());
@@ -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.\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',
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.\n\n- Always pass either the \\`workspace\\` or \\`teamId\\` query to scope results. Prefer \\`workspace\\` when known.\n- If you need team-scoped results, set \\`teamId\\` from the current user: call GET \\`/me\\` and use \\`me.teamId\\`.\n- If both \\`teamId\\` and \\`workspace\\` are passed, only \\`workspace\\` is used.\n',
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.\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',
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.\n\n**Note:**\n\nTagging is available on Postman [**Enterprise** plans](https://www.postman.com/pricing/).\n',
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: "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 ([**Professional** 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 ([**Professional** and **Enterprise** plans only](https://www.postman.com/pricing)).\n",
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: "Gets all workspaces you have access to.\n- For “my …” requests, first call GET \\`/me\\` and pass \\`createdBy={me.user.id}\\`.\n- This endpoint's response contains the visibility field. 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 (Professional and Enterprise).\n - \\`public\\` — Everyone can access the workspace.\n - \\`partner\\` — Invited team members and partners (Professional and Enterprise).\n- For tools that require the workspace ID, and no workspace ID is provided, ask the user to provide the workspace ID. If the user does not provide the workspace ID, call this first with the createdBy parameter to use the first workspace.\n- Examples:\n - “List my workspaces” → GET \\`/me\\`, then GET \\`/workspaces?createdBy={me.user.id}\\`\n - “List my personal workspaces” → GET \\`/me\\`, then GET \\`/workspaces?type=personal&createdBy={me.user.id}\\`\n - “List all public workspaces” → GET \\`/workspaces?type=public\\`\n",
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.**\n\nMerges a forked collection back into its parent collection. You must have the [Editor role](https://learning.postman.com/docs/collaborating-in-postman/roles-and-permissions/#collection-roles) for the collection to merge a fork.\n',
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).\n',
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.\n\n**Note:**\n\n- You can only perform one type of operation at a time. For example, you cannot perform an \\`add\\` and \\`replace\\` operation in the same call.\n- The request body size cannot exceed the maximum allowed size of 30MB.\n- If you receive an HTTP \\`411 Length Required\\` error response, manually pass the \\`Content-Length\\` header and its value in the request header.\n- To add a description to an existing variable, use the \\`add\\` operation.\n',
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.\n\n**Note:**\n\nYou can only pass one element object type per call. For example, you cannot pass both \\`api\\` and \\`collection\\` in a single request.\n",
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.\n\n**Note:**\n\n- Your [Postman plan](https://www.postman.com/pricing/) impacts your use of these endpoints:\n - For **Free** and **Basic** 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",
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,
@@ -4,7 +4,7 @@ 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
5
  export const parameters = z.object({ collectionId: z.string().describe("The collection's ID.") });
6
6
  export const annotations = {
7
- title: "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",
7
+ title: "Pulls the changes from a parent (source) collection into the forked collection. In the endpoint's response:",
8
8
  readOnlyHint: false,
9
9
  destructiveHint: false,
10
10
  idempotentHint: true,
@@ -877,7 +877,7 @@ export const parameters = z.object({
877
877
  .optional(),
878
878
  });
879
879
  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.\n\nTo 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\n**Note:**\n\n- The maximum collection size this endpoint accepts cannot exceed 100 MB.\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- 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",
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.",
881
881
  readOnlyHint: false,
882
882
  destructiveHint: false,
883
883
  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.\n\n**Note:**\n\n- The request body size cannot exceed the maximum allowed size of 30MB.\n- If you receive an HTTP \\`411 Length Required\\` error response, manually pass the \\`Content-Length\\` header and its value in the request header.\n',
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.\n\nComment thread IDs return in the GET comments response for [APIs](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-2103ea20-f7de-4628-90e6-b823b3084a52), [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',
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: "Runs a monitor and returns its run results.\n\n**Note:**\n\n- If you pass the \\`async=true\\` query parameter, the response does not return the \\`stats\\`, \\`executions\\`, and \\`failures\\` responses. To get this information for an asynchronous run, call the GET \\`/monitors/{id}\\` endpoint.\n- If the call exceeds 300 seconds, the endpoint returns an HTTP \\`202 Accepted\\` response. Use the GET \\`/monitors/{id}\\` endpoint to check the run's status in the response's \\`lastRun\\` property. To avoid this, it is recommended that you include the \\`async=true\\` query parameter when using this endpoint.\n",
13
+ title: 'Runs a monitor and returns its run results.',
14
14
  readOnlyHint: false,
15
15
  destructiveHint: false,
16
16
  idempotentHint: false,
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { asMcpError, McpError } from './utils/toolHelpers.js';
3
3
  export const method = 'searchPostmanElements';
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 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- Currently supports searching for requests (entityType: "requests")\n';
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
5
  export const parameters = z.object({
6
6
  entityType: z
7
- .literal('requests')
8
- .describe('The type of Postman [entity](https://learning.postman.com/docs/getting-started/basics/postman-elements/) (element) to search for. At this time, this only accepts the `requests` value.'),
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
9
  q: z
10
10
  .string()
11
11
  .min(1)
@@ -29,14 +29,14 @@ export const parameters = z.object({
29
29
  .default(10),
30
30
  });
31
31
  export const annotations = {
32
- title: '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 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- Currently supports searching for requests (entityType: "requests")\n',
32
+ title: 'Searches for Postman elements in the public network.',
33
33
  readOnlyHint: true,
34
34
  destructiveHint: false,
35
35
  idempotentHint: true,
36
36
  };
37
37
  export async function handler(args, extra) {
38
38
  try {
39
- const endpoint = `/search/${args.entityType}`;
39
+ const endpoint = '/search/requests';
40
40
  const query = new URLSearchParams();
41
41
  if (args.q !== undefined)
42
42
  query.set('q', String(args.q));
@@ -51,11 +51,43 @@ export async function handler(args, extra) {
51
51
  headers: extra.headers,
52
52
  };
53
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
+ }
54
86
  return {
55
87
  content: [
56
88
  {
57
89
  type: 'text',
58
- text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
90
+ text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
59
91
  },
60
92
  ],
61
93
  };
@@ -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.\n\n**Note:**\n\n- This endpoint only supports the OpenAPI 3.0 specification type.\n- You can only sync collections generated from the given spec ID.\n',
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,
@@ -7,7 +7,7 @@ export const parameters = z.object({
7
7
  collectionUid: z.string().describe("The collection's unique ID."),
8
8
  });
9
9
  export const annotations = {
10
- title: 'Syncs an API specification linked to a collection. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response.\n\n**Note:**\n\n- This endpoint only supports the OpenAPI 3.0 specification type.\n- You can only sync specs generated from the given collection ID.\n',
10
+ title: 'Syncs an API specification linked to a collection. This is an asynchronous endpoint that returns an HTTP \\`202 Accepted\\` response.',
11
11
  readOnlyHint: false,
12
12
  destructiveHint: false,
13
13
  idempotentHint: true,
@@ -22,7 +22,7 @@ export const parameters = z.object({
22
22
  .optional(),
23
23
  });
24
24
  export const annotations = {
25
- title: "Updates a comment on an API's collection.\n\n**Note:**\n\nThis endpoint accepts a max of 10,000 characters.\n",
25
+ title: "Updates a comment on an API's collection.",
26
26
  readOnlyHint: false,
27
27
  destructiveHint: false,
28
28
  idempotentHint: true,
@@ -21,7 +21,7 @@ export const parameters = z.object({
21
21
  .optional(),
22
22
  });
23
23
  export const annotations = {
24
- title: 'Updates a comment on a collection.\n\n**Note:**\n\nThis endpoint accepts a max of 10,000 characters.\n',
24
+ title: 'Updates a comment on a collection.',
25
25
  readOnlyHint: false,
26
26
  destructiveHint: false,
27
27
  idempotentHint: true,
@@ -10,7 +10,7 @@ export const parameters = z.object({
10
10
  description: z.string().describe("The folder's description.").optional(),
11
11
  });
12
12
  export const annotations = {
13
- title: 'Updates a folder in a collection. For a complete list of properties, refer to the **Folder** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).\n\n**Note:**\n\nThis endpoint acts like a PATCH method. It only updates the values that you pass in the request body (for example, the \\`name\\` property). The endpoint does not update the entire resource.\n',
13
+ title: 'Updates a folder in a collection. For a complete list of properties, refer to the **Folder** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
14
14
  readOnlyHint: false,
15
15
  destructiveHint: false,
16
16
  idempotentHint: true,
@@ -180,7 +180,7 @@ export const parameters = z.object({
180
180
  .optional(),
181
181
  });
182
182
  export const annotations = {
183
- title: 'Updates a request in a collection. For a complete list of properties, refer to the **Request** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).\n\n**Note:**\n\n- You must pass a collection ID (\\`12ece9e1-2abf-4edc-8e34-de66e74114d2\\`), not a collection(\\`12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2\\`), in this endpoint.\n- This endpoint does not support changing the folder of a request.\n- This endpoint acts like a PATCH method. It only updates the values that you pass in the request body.',
183
+ title: 'Updates a request in a collection. For a complete list of properties, refer to the **Request** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
184
184
  readOnlyHint: false,
185
185
  destructiveHint: false,
186
186
  idempotentHint: true,
@@ -16,7 +16,7 @@ export const parameters = z.object({
16
16
  .optional(),
17
17
  });
18
18
  export const annotations = {
19
- title: 'Updates a response in a collection. For a complete list of properties, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).\n\n**Note:**\n\n- You must pass a collection ID (\\`12ece9e1-2abf-4edc-8e34-de66e74114d2\\`), not a collection UID (\\`12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2\\`), in this endpoint.\n- This endpoint acts like a PATCH method. It only updates the values that you pass in the request body (for example, the \\`name\\` property). The endpoint does not update the entire resource.\n',
19
+ title: 'Updates a response in a collection. For a complete list of properties, see the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
20
20
  readOnlyHint: false,
21
21
  destructiveHint: false,
22
22
  idempotentHint: true,
@@ -22,7 +22,7 @@ export const parameters = z.object({
22
22
  .optional(),
23
23
  });
24
24
  export const annotations = {
25
- title: 'Updates a comment on a folder.\n\n**Note:**\n\nThis endpoint accepts a max of 10,000 characters.\n',
25
+ title: 'Updates a comment on a folder.',
26
26
  readOnlyHint: false,
27
27
  destructiveHint: false,
28
28
  idempotentHint: true,
@@ -32,7 +32,7 @@ export const parameters = z.object({
32
32
  .optional(),
33
33
  });
34
34
  export const annotations = {
35
- title: 'Updates a mock server.\n- Resource: Mock server entity associated with a collection UID.\n- Use this to change name, environment, privacy, or default server response.\n',
35
+ title: 'Updates a mock server.',
36
36
  readOnlyHint: false,
37
37
  destructiveHint: false,
38
38
  idempotentHint: true,