@postman/postman-mcp-server 2.1.4 → 2.2.0-alpha.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 (112) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/clients/postman.js +68 -29
  3. package/dist/src/enabledResources.js +3 -2
  4. package/dist/src/index.js +38 -17
  5. package/dist/src/tools/createCollection.js +4 -5
  6. package/dist/src/tools/createCollectionComment.js +5 -6
  7. package/dist/src/tools/createCollectionFolder.js +4 -5
  8. package/dist/src/tools/createCollectionFork.js +4 -5
  9. package/dist/src/tools/createCollectionRequest.js +4 -5
  10. package/dist/src/tools/createCollectionResponse.js +4 -5
  11. package/dist/src/tools/createEnvironment.js +13 -8
  12. package/dist/src/tools/createFolderComment.js +5 -6
  13. package/dist/src/tools/createMock.js +4 -5
  14. package/dist/src/tools/createMonitor.js +5 -5
  15. package/dist/src/tools/createRequestComment.js +5 -6
  16. package/dist/src/tools/createResponseComment.js +5 -6
  17. package/dist/src/tools/createSpec.js +17 -29
  18. package/dist/src/tools/createSpecFile.js +4 -5
  19. package/dist/src/tools/createWorkspace.js +4 -5
  20. package/dist/src/tools/deleteApiCollectionComment.js +3 -5
  21. package/dist/src/tools/deleteCollection.js +3 -5
  22. package/dist/src/tools/deleteCollectionComment.js +3 -5
  23. package/dist/src/tools/deleteCollectionFolder.js +3 -5
  24. package/dist/src/tools/deleteCollectionRequest.js +3 -5
  25. package/dist/src/tools/deleteCollectionResponse.js +3 -5
  26. package/dist/src/tools/deleteEnvironment.js +3 -5
  27. package/dist/src/tools/deleteFolderComment.js +3 -5
  28. package/dist/src/tools/deleteMock.js +3 -5
  29. package/dist/src/tools/deleteMonitor.js +3 -5
  30. package/dist/src/tools/deletePanElementOrFolder.js +3 -5
  31. package/dist/src/tools/deleteRequestComment.js +3 -5
  32. package/dist/src/tools/deleteResponseComment.js +3 -5
  33. package/dist/src/tools/deleteSpec.js +3 -5
  34. package/dist/src/tools/deleteSpecFile.js +3 -5
  35. package/dist/src/tools/deleteWorkspace.js +3 -5
  36. package/dist/src/tools/duplicateCollection.js +4 -5
  37. package/dist/src/tools/generateCollection.js +8 -5
  38. package/dist/src/tools/generateSpecFromCollection.js +4 -5
  39. package/dist/src/tools/getAllElementsAndFolders.js +3 -5
  40. package/dist/src/tools/getAllPanAddElementRequests.js +3 -5
  41. package/dist/src/tools/getAllSpecs.js +3 -5
  42. package/dist/src/tools/getAsyncSpecTaskStatus.js +3 -5
  43. package/dist/src/tools/getAuthenticatedUser.js +3 -5
  44. package/dist/src/tools/getCollection.js +3 -5
  45. package/dist/src/tools/getCollectionComments.js +3 -5
  46. package/dist/src/tools/getCollectionFolder.js +3 -5
  47. package/dist/src/tools/getCollectionForks.js +3 -5
  48. package/dist/src/tools/getCollectionRequest.js +3 -5
  49. package/dist/src/tools/getCollectionResponse.js +3 -5
  50. package/dist/src/tools/getCollectionTags.js +3 -5
  51. package/dist/src/tools/getCollectionUpdatesTasks.js +3 -5
  52. package/dist/src/tools/getCollections.js +3 -5
  53. package/dist/src/tools/getCollectionsForkedByUser.js +3 -5
  54. package/dist/src/tools/getDuplicateCollectionTaskStatus.js +3 -5
  55. package/dist/src/tools/getEnvironment.js +3 -5
  56. package/dist/src/tools/getEnvironments.js +3 -5
  57. package/dist/src/tools/getFolderComments.js +3 -5
  58. package/dist/src/tools/getGeneratedCollectionSpecs.js +3 -5
  59. package/dist/src/tools/getMock.js +3 -5
  60. package/dist/src/tools/getMocks.js +3 -5
  61. package/dist/src/tools/getMonitor.js +3 -5
  62. package/dist/src/tools/getMonitors.js +3 -5
  63. package/dist/src/tools/getRequestComments.js +3 -5
  64. package/dist/src/tools/getResponseComments.js +3 -5
  65. package/dist/src/tools/getSourceCollectionStatus.js +3 -5
  66. package/dist/src/tools/getSpec.js +3 -5
  67. package/dist/src/tools/getSpecCollections.js +3 -5
  68. package/dist/src/tools/getSpecDefinition.js +3 -5
  69. package/dist/src/tools/getSpecFile.js +3 -5
  70. package/dist/src/tools/getSpecFiles.js +3 -5
  71. package/dist/src/tools/{getStatusOfAnAsyncTask.js → getStatusOfAnAsyncApiTask.js} +4 -6
  72. package/dist/src/tools/getTaggedEntities.js +3 -5
  73. package/dist/src/tools/getWorkspace.js +3 -5
  74. package/dist/src/tools/getWorkspaceGlobalVariables.js +3 -5
  75. package/dist/src/tools/getWorkspaceTags.js +3 -5
  76. package/dist/src/tools/getWorkspaces.js +3 -5
  77. package/dist/src/tools/mergeCollectionFork.js +57 -0
  78. package/dist/src/tools/patchCollection.js +12 -16
  79. package/dist/src/tools/patchEnvironment.js +5 -7
  80. package/dist/src/tools/postPanElementOrFolder.js +3 -5
  81. package/dist/src/tools/publishDocumentation.js +4 -5
  82. package/dist/src/tools/publishMock.js +3 -5
  83. package/dist/src/tools/pullCollectionChanges.js +3 -5
  84. package/dist/src/tools/putCollection.js +4 -5
  85. package/dist/src/tools/putEnvironment.js +13 -8
  86. package/dist/src/tools/resolveCommentThread.js +3 -5
  87. package/dist/src/tools/runMonitor.js +5 -7
  88. package/dist/src/tools/syncCollectionWithSpec.js +3 -5
  89. package/dist/src/tools/syncSpecWithCollection.js +3 -5
  90. package/dist/src/tools/transferCollectionFolders.js +4 -5
  91. package/dist/src/tools/transferCollectionRequests.js +4 -5
  92. package/dist/src/tools/transferCollectionResponses.js +4 -5
  93. package/dist/src/tools/unpublishDocumentation.js +3 -5
  94. package/dist/src/tools/unpublishMock.js +3 -5
  95. package/dist/src/tools/updateApiCollectionComment.js +4 -5
  96. package/dist/src/tools/updateCollectionComment.js +4 -5
  97. package/dist/src/tools/updateCollectionFolder.js +4 -5
  98. package/dist/src/tools/updateCollectionRequest.js +4 -5
  99. package/dist/src/tools/updateCollectionResponse.js +4 -5
  100. package/dist/src/tools/updateCollectionTags.js +4 -5
  101. package/dist/src/tools/updateFolderComment.js +4 -5
  102. package/dist/src/tools/updateMock.js +4 -5
  103. package/dist/src/tools/updateMonitor.js +5 -5
  104. package/dist/src/tools/updatePanElementOrFolder.js +3 -5
  105. package/dist/src/tools/updateRequestComment.js +4 -5
  106. package/dist/src/tools/updateResponseComment.js +4 -5
  107. package/dist/src/tools/updateSpecFile.js +4 -5
  108. package/dist/src/tools/updateSpecProperties.js +4 -5
  109. package/dist/src/tools/updateWorkspace.js +4 -5
  110. package/dist/src/tools/updateWorkspaceGlobalVariables.js +5 -5
  111. package/dist/src/tools/updateWorkspaceTags.js +4 -5
  112. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+ import { ContentType } from '../clients/postman.js';
3
+ import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
+ function asMcpError(error) {
5
+ const cause = error?.cause ?? String(error);
6
+ return new McpError(ErrorCode.InternalError, cause);
7
+ }
8
+ export const method = 'mergeCollectionFork';
9
+ export const description = '**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';
10
+ export const parameters = z.object({
11
+ destination: z.string().describe("The destination (parent) collection's unique ID."),
12
+ source: z.string().describe("The source collection's unique ID."),
13
+ strategy: z
14
+ .enum(['deleteSource', 'updateSourceWithDestination'])
15
+ .describe("The fork's merge strategy:\n- `deleteSource` — Merge the changes into the parent collection. After the merge process is complete, Postman deletes the fork. You must have Editor access to both the parent and forked collections.\n- `updateSourceWithDestination` — Merge the changes into the parent collection. Any differences in the parent collection are also made to the fork.\n")
16
+ .default('updateSourceWithDestination'),
17
+ });
18
+ export const annotations = {
19
+ 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',
20
+ readOnlyHint: false,
21
+ destructiveHint: false,
22
+ idempotentHint: false,
23
+ };
24
+ export async function handler(params, extra) {
25
+ try {
26
+ const endpoint = `/collections/merge`;
27
+ const query = new URLSearchParams();
28
+ const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
29
+ const bodyPayload = {};
30
+ if (params.destination !== undefined)
31
+ bodyPayload.destination = params.destination;
32
+ if (params.source !== undefined)
33
+ bodyPayload.source = params.source;
34
+ if (params.strategy !== undefined)
35
+ bodyPayload.strategy = params.strategy;
36
+ const options = {
37
+ body: JSON.stringify(bodyPayload),
38
+ contentType: ContentType.Json,
39
+ headers: extra.headers,
40
+ };
41
+ const result = await extra.client.post(url, options);
42
+ return {
43
+ content: [
44
+ {
45
+ type: 'text',
46
+ text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
47
+ },
48
+ ],
49
+ };
50
+ }
51
+ catch (e) {
52
+ if (e instanceof McpError) {
53
+ throw e;
54
+ }
55
+ throw asMcpError(e);
56
+ }
57
+ }
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
6
6
  return new McpError(ErrorCode.InternalError, cause);
7
7
  }
8
8
  export const method = 'patchCollection';
9
- export const description = 'Updates specific collection information, such as its name, events, or its variables. For more information about the \\`auth\\`, \\`variable\\`, and \\`events\\` properties, refer to the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html):\n- For \\`variable\\`, refer to the **Variable List** entry. Also accepts \\`variables\\`.\n- For \\`auth\\`, refer to the **Auth** entry.\n- For \\`events\\`, refer to the **Event List** entry.\n';
9
+ export const description = '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';
10
10
  export const parameters = z.object({
11
11
  collectionId: z
12
12
  .string()
@@ -28,18 +28,14 @@ export const parameters = z.object({
28
28
  .describe("The variable's ID. Doesn't apply to collection-level variables.")
29
29
  .optional(),
30
30
  key: z.string().describe("The variable's key (name).").optional(),
31
- description: z
32
- .string()
33
- .describe("The variable's description. Doesn't apply to collection-level variables.")
34
- .optional(),
35
- value: z.string().describe("The key's value.").optional(),
36
- type: z
37
- .enum(['string', 'boolean', 'integer'])
38
- .describe("The variable's type.")
31
+ description: z.string().max(512).describe("The variable's description.").optional(),
32
+ value: z
33
+ .union([z.string(), z.boolean(), z.number().int()])
34
+ .describe("The key's value.")
39
35
  .optional(),
40
36
  disabled: z
41
37
  .boolean()
42
- .describe('If true, the variable is not enabled. Applies only to query parameter variables.')
38
+ .describe("If true, the variable is not enabled. Doesn't apply to path parameter variables.")
43
39
  .default(false),
44
40
  })
45
41
  .describe('Information about the variable.'))
@@ -281,12 +277,13 @@ export const parameters = z.object({
281
277
  .optional(),
282
278
  })
283
279
  .describe("Information about the collection's events."))
280
+ .describe('A list of scripts configured to run when specific events occur. These scripts can be referenced in the collection by their ID.')
284
281
  .optional(),
285
282
  })
286
283
  .optional(),
287
284
  });
288
285
  export const annotations = {
289
- title: 'Updates specific collection information, such as its name, events, or its variables. For more information about the \\`auth\\`, \\`variable\\`, and \\`events\\` properties, refer to the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html):\n- For \\`variable\\`, refer to the **Variable List** entry. Also accepts \\`variables\\`.\n- For \\`auth\\`, refer to the **Auth** entry.\n- For \\`events\\`, refer to the **Event List** entry.\n',
286
+ 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',
290
287
  readOnlyHint: false,
291
288
  destructiveHint: false,
292
289
  idempotentHint: true,
@@ -299,13 +296,12 @@ export async function handler(params, extra) {
299
296
  const bodyPayload = {};
300
297
  if (params.collection !== undefined)
301
298
  bodyPayload.collection = params.collection;
302
- const result = await fetchPostmanAPI(url, {
303
- method: 'PATCH',
299
+ const options = {
304
300
  body: JSON.stringify(bodyPayload),
305
301
  contentType: ContentType.Json,
306
- apiKey: extra.apiKey,
307
302
  headers: extra.headers,
308
- });
303
+ };
304
+ const result = await extra.client.patch(url, options);
309
305
  return {
310
306
  content: [
311
307
  {
@@ -1,15 +1,14 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
6
5
  return new McpError(ErrorCode.InternalError, cause);
7
6
  }
8
7
  export const method = 'patchEnvironment';
9
- export const description = 'Updates specific environment properties, such as its name and variables.\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';
8
+ export const description = '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';
10
9
  export const parameters = z.object({ environmentId: z.string().describe("The environment's ID.") });
11
10
  export const annotations = {
12
- title: 'Updates specific environment properties, such as its name and variables.\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',
11
+ 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',
13
12
  readOnlyHint: false,
14
13
  destructiveHint: false,
15
14
  idempotentHint: true,
@@ -19,11 +18,10 @@ export async function handler(params, extra) {
19
18
  const endpoint = `/environments/${params.environmentId}`;
20
19
  const query = new URLSearchParams();
21
20
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
22
- const result = await fetchPostmanAPI(url, {
23
- method: 'PATCH',
24
- apiKey: extra.apiKey,
21
+ const options = {
25
22
  headers: extra.headers,
26
- });
23
+ };
24
+ const result = await extra.client.patch(url, options);
27
25
  return {
28
26
  content: [
29
27
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -19,11 +18,10 @@ export async function handler(params, extra) {
19
18
  const endpoint = `/network/private`;
20
19
  const query = new URLSearchParams();
21
20
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
22
- const result = await fetchPostmanAPI(url, {
23
- method: 'POST',
24
- apiKey: extra.apiKey,
21
+ const options = {
25
22
  headers: extra.headers,
26
- });
23
+ };
24
+ const result = await extra.client.post(url, options);
27
25
  return {
28
26
  content: [
29
27
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -104,13 +104,12 @@ export async function handler(params, extra) {
104
104
  bodyPayload.documentationLayout = params.documentationLayout;
105
105
  if (params.customization !== undefined)
106
106
  bodyPayload.customization = params.customization;
107
- const result = await fetchPostmanAPI(url, {
108
- method: 'PUT',
107
+ const options = {
109
108
  body: JSON.stringify(bodyPayload),
110
109
  contentType: ContentType.Json,
111
- apiKey: extra.apiKey,
112
110
  headers: extra.headers,
113
- });
111
+ };
112
+ const result = await extra.client.put(url, options);
114
113
  return {
115
114
  content: [
116
115
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -19,11 +18,10 @@ export async function handler(params, extra) {
19
18
  const endpoint = `/mocks/${params.mockId}/publish`;
20
19
  const query = new URLSearchParams();
21
20
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
22
- const result = await fetchPostmanAPI(url, {
23
- method: 'POST',
24
- apiKey: extra.apiKey,
21
+ const options = {
25
22
  headers: extra.headers,
26
- });
23
+ };
24
+ const result = await extra.client.post(url, options);
27
25
  return {
28
26
  content: [
29
27
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -19,11 +18,10 @@ export async function handler(params, extra) {
19
18
  const endpoint = `/collections/${params.collectionId}/pulls`;
20
19
  const query = new URLSearchParams();
21
20
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
22
- const result = await fetchPostmanAPI(url, {
23
- method: 'PUT',
24
- apiKey: extra.apiKey,
21
+ const options = {
25
22
  headers: extra.headers,
26
- });
23
+ };
24
+ const result = await extra.client.put(url, options);
27
25
  return {
28
26
  content: [
29
27
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -894,13 +894,12 @@ export async function handler(params, extra) {
894
894
  const bodyPayload = {};
895
895
  if (params.collection !== undefined)
896
896
  bodyPayload.collection = params.collection;
897
- const result = await fetchPostmanAPI(url, {
898
- method: 'PUT',
897
+ const options = {
899
898
  body: JSON.stringify(bodyPayload),
900
899
  contentType: ContentType.Json,
901
- apiKey: extra.apiKey,
902
900
  headers: extra.headers,
903
- });
901
+ };
902
+ const result = await extra.client.put(url, options);
904
903
  return {
905
904
  content: [
906
905
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -13,12 +13,18 @@ export const parameters = z.object({
13
13
  .object({
14
14
  name: z.string().describe("The environment's name.").optional(),
15
15
  values: z
16
- .array(z.object({
16
+ .array(z
17
+ .object({
17
18
  enabled: z.boolean().describe('If true, the variable is enabled.').optional(),
18
19
  key: z.string().describe("The variable's name.").optional(),
19
20
  value: z.string().describe("The variable's value.").optional(),
20
- type: z.enum(['secret', 'default']).describe('The variable type.').optional(),
21
- }))
21
+ type: z
22
+ .enum(['secret', 'default'])
23
+ .describe("The variable's type:\n- `secret` — The variable value is masked.\n- `default` — The variable value is visible in plain text.\n")
24
+ .optional(),
25
+ description: z.string().max(512).describe("The variable's description.").optional(),
26
+ })
27
+ .describe("Information about the environment's variables."))
22
28
  .describe("Information about the environment's variables.")
23
29
  .optional(),
24
30
  })
@@ -39,13 +45,12 @@ export async function handler(params, extra) {
39
45
  const bodyPayload = {};
40
46
  if (params.environment !== undefined)
41
47
  bodyPayload.environment = params.environment;
42
- const result = await fetchPostmanAPI(url, {
43
- method: 'PUT',
48
+ const options = {
44
49
  body: JSON.stringify(bodyPayload),
45
50
  contentType: ContentType.Json,
46
- apiKey: extra.apiKey,
47
51
  headers: extra.headers,
48
- });
52
+ };
53
+ const result = await extra.client.put(url, options);
49
54
  return {
50
55
  content: [
51
56
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -21,11 +20,10 @@ export async function handler(params, extra) {
21
20
  const endpoint = `/comments-resolutions/${params.threadId}`;
22
21
  const query = new URLSearchParams();
23
22
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
24
- const result = await fetchPostmanAPI(url, {
25
- method: 'POST',
26
- apiKey: extra.apiKey,
23
+ const options = {
27
24
  headers: extra.headers,
28
- });
25
+ };
26
+ const result = await extra.client.post(url, options);
29
27
  return {
30
28
  content: [
31
29
  {
@@ -1,12 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
6
5
  return new McpError(ErrorCode.InternalError, cause);
7
6
  }
8
7
  export const method = 'runMonitor';
9
- export const description = 'Runs a monitor and returns its run results.\n\n**Note:**\n\n- This endpoint has a timeout restriction of 300 seconds. It is recommended that you include the \\`async=true\\` query parameter when using this endpoint.\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';
8
+ export const description = "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";
10
9
  export const parameters = z.object({
11
10
  monitorId: z.string().describe("The monitor's ID."),
12
11
  async: z
@@ -15,7 +14,7 @@ export const parameters = z.object({
15
14
  .default(false),
16
15
  });
17
16
  export const annotations = {
18
- title: 'Runs a monitor and returns its run results.\n\n**Note:**\n\n- This endpoint has a timeout restriction of 300 seconds. It is recommended that you include the \\`async=true\\` query parameter when using this endpoint.\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',
17
+ 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",
19
18
  readOnlyHint: false,
20
19
  destructiveHint: false,
21
20
  idempotentHint: false,
@@ -27,11 +26,10 @@ export async function handler(params, extra) {
27
26
  if (params.async !== undefined)
28
27
  query.set('async', String(params.async));
29
28
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
30
- const result = await fetchPostmanAPI(url, {
31
- method: 'POST',
32
- apiKey: extra.apiKey,
29
+ const options = {
33
30
  headers: extra.headers,
34
- });
31
+ };
32
+ const result = await extra.client.post(url, options);
35
33
  return {
36
34
  content: [
37
35
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -24,11 +23,10 @@ export async function handler(params, extra) {
24
23
  if (params.specId !== undefined)
25
24
  query.set('specId', String(params.specId));
26
25
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
27
- const result = await fetchPostmanAPI(url, {
28
- method: 'PUT',
29
- apiKey: extra.apiKey,
26
+ const options = {
30
27
  headers: extra.headers,
31
- });
28
+ };
29
+ const result = await extra.client.put(url, options);
32
30
  return {
33
31
  content: [
34
32
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -24,11 +23,10 @@ export async function handler(params, extra) {
24
23
  if (params.collectionUid !== undefined)
25
24
  query.set('collectionUid', String(params.collectionUid));
26
25
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
27
- const result = await fetchPostmanAPI(url, {
28
- method: 'PUT',
29
- apiKey: extra.apiKey,
26
+ const options = {
30
27
  headers: extra.headers,
31
- });
28
+ };
29
+ const result = await extra.client.put(url, options);
32
30
  return {
33
31
  content: [
34
32
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -59,13 +59,12 @@ export async function handler(params, extra) {
59
59
  bodyPayload.target = params.target;
60
60
  if (params.location !== undefined)
61
61
  bodyPayload.location = params.location;
62
- const result = await fetchPostmanAPI(url, {
63
- method: 'POST',
62
+ const options = {
64
63
  body: JSON.stringify(bodyPayload),
65
64
  contentType: ContentType.Json,
66
- apiKey: extra.apiKey,
67
65
  headers: extra.headers,
68
- });
66
+ };
67
+ const result = await extra.client.post(url, options);
69
68
  return {
70
69
  content: [
71
70
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -59,13 +59,12 @@ export async function handler(params, extra) {
59
59
  bodyPayload.target = params.target;
60
60
  if (params.location !== undefined)
61
61
  bodyPayload.location = params.location;
62
- const result = await fetchPostmanAPI(url, {
63
- method: 'POST',
62
+ const options = {
64
63
  body: JSON.stringify(bodyPayload),
65
64
  contentType: ContentType.Json,
66
- apiKey: extra.apiKey,
67
65
  headers: extra.headers,
68
- });
66
+ };
67
+ const result = await extra.client.post(url, options);
69
68
  return {
70
69
  content: [
71
70
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -59,13 +59,12 @@ export async function handler(params, extra) {
59
59
  bodyPayload.target = params.target;
60
60
  if (params.location !== undefined)
61
61
  bodyPayload.location = params.location;
62
- const result = await fetchPostmanAPI(url, {
63
- method: 'POST',
62
+ const options = {
64
63
  body: JSON.stringify(bodyPayload),
65
64
  contentType: ContentType.Json,
66
- apiKey: extra.apiKey,
67
65
  headers: extra.headers,
68
- });
66
+ };
67
+ const result = await extra.client.post(url, options);
69
68
  return {
70
69
  content: [
71
70
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -21,11 +20,10 @@ export async function handler(params, extra) {
21
20
  const endpoint = `/collections/${params.collectionId}/public-documentations`;
22
21
  const query = new URLSearchParams();
23
22
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
24
- const result = await fetchPostmanAPI(url, {
25
- method: 'DELETE',
26
- apiKey: extra.apiKey,
23
+ const options = {
27
24
  headers: extra.headers,
28
- });
25
+ };
26
+ const result = await extra.client.delete(url, options);
29
27
  return {
30
28
  content: [
31
29
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -19,11 +18,10 @@ export async function handler(params, extra) {
19
18
  const endpoint = `/mocks/${params.mockId}/unpublish`;
20
19
  const query = new URLSearchParams();
21
20
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
22
- const result = await fetchPostmanAPI(url, {
23
- method: 'DELETE',
24
- apiKey: extra.apiKey,
21
+ const options = {
25
22
  headers: extra.headers,
26
- });
23
+ };
24
+ const result = await extra.client.delete(url, options);
27
25
  return {
28
26
  content: [
29
27
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -41,13 +41,12 @@ export async function handler(params, extra) {
41
41
  bodyPayload.body = params.body;
42
42
  if (params.tags !== undefined)
43
43
  bodyPayload.tags = params.tags;
44
- const result = await fetchPostmanAPI(url, {
45
- method: 'PUT',
44
+ const options = {
46
45
  body: JSON.stringify(bodyPayload),
47
46
  contentType: ContentType.Json,
48
- apiKey: extra.apiKey,
49
47
  headers: extra.headers,
50
- });
48
+ };
49
+ const result = await extra.client.put(url, options);
51
50
  return {
52
51
  content: [
53
52
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -40,13 +40,12 @@ export async function handler(params, extra) {
40
40
  bodyPayload.body = params.body;
41
41
  if (params.tags !== undefined)
42
42
  bodyPayload.tags = params.tags;
43
- const result = await fetchPostmanAPI(url, {
44
- method: 'PUT',
43
+ const options = {
45
44
  body: JSON.stringify(bodyPayload),
46
45
  contentType: ContentType.Json,
47
- apiKey: extra.apiKey,
48
46
  headers: extra.headers,
49
- });
47
+ };
48
+ const result = await extra.client.put(url, options);
50
49
  return {
51
50
  content: [
52
51
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -29,13 +29,12 @@ export async function handler(params, extra) {
29
29
  bodyPayload.name = params.name;
30
30
  if (params.description !== undefined)
31
31
  bodyPayload.description = params.description;
32
- const result = await fetchPostmanAPI(url, {
33
- method: 'PUT',
32
+ const options = {
34
33
  body: JSON.stringify(bodyPayload),
35
34
  contentType: ContentType.Json,
36
- apiKey: extra.apiKey,
37
35
  headers: extra.headers,
38
- });
36
+ };
37
+ const result = await extra.client.put(url, options);
39
38
  return {
40
39
  content: [
41
40
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -48,13 +48,12 @@ export async function handler(params, extra) {
48
48
  bodyPayload.name = params.name;
49
49
  if (params.method !== undefined)
50
50
  bodyPayload.method = params.method;
51
- const result = await fetchPostmanAPI(url, {
52
- method: 'PUT',
51
+ const options = {
53
52
  body: JSON.stringify(bodyPayload),
54
53
  contentType: ContentType.Json,
55
- apiKey: extra.apiKey,
56
54
  headers: extra.headers,
57
- });
55
+ };
56
+ const result = await extra.client.put(url, options);
58
57
  return {
59
58
  content: [
60
59
  {