@postman/postman-mcp-server 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/package.json +15 -13
- package/dist/src/clients/postman.js +2 -0
- package/dist/src/enabledResources.js +14 -9
- package/dist/src/index.js +29 -1
- package/dist/src/tools/addWorkspaceToPrivateNetwork.js +47 -0
- package/dist/src/tools/createCollectionRequest.js +255 -94
- package/dist/src/tools/createCollectionResponse.js +125 -3
- package/dist/src/tools/createSpec.js +16 -4
- package/dist/src/tools/createWorkspace.js +6 -2
- package/dist/src/tools/deleteWorkspace.js +1 -1
- package/dist/src/tools/generateCollection.js +2 -2
- package/dist/src/tools/getAnalyticsData.js +107 -0
- package/dist/src/tools/getAnalyticsMetadata.js +55 -0
- package/dist/src/tools/getCodeGenerationInstructions.js +12 -6
- package/dist/src/tools/getCollection/getCollectionMap.js +2 -2
- package/dist/src/tools/getWorkspace.js +1 -1
- package/dist/src/tools/{getAllPanAddElementRequests.js → listPrivateNetworkAddRequests.js} +9 -16
- package/dist/src/tools/{getAllElementsAndFolders.js → listPrivateNetworkWorkspaces.js} +27 -34
- package/dist/src/tools/publishDocumentation.js +1 -1
- package/dist/src/tools/pullCollectionChanges.js +3 -1
- package/dist/src/tools/putCollection.js +11 -1
- package/dist/src/tools/removeWorkspaceFromPrivateNetwork.js +36 -0
- package/dist/src/tools/resolveCommentThread.js +1 -1
- package/dist/src/tools/respondPrivateNetworkAddRequest.js +56 -0
- package/dist/src/tools/searchPostmanElementsInPrivateNetwork.js +127 -0
- package/dist/src/tools/{searchPostmanElements.js → searchPostmanElementsInPublicNetwork.js} +1 -1
- package/dist/src/tools/updateCollectionRequest.js +254 -97
- package/dist/src/tools/updateCollectionResponse.js +113 -0
- package/dist/src/tools/updateWorkspace.js +1 -1
- package/dist/src/tools/utils/errorTemplateRenderer.js +23 -0
- package/dist/src/views/errors/getCollectionFolder.404.njk +5 -0
- package/dist/src/views/errors/getCollectionRequest.404.njk +5 -0
- package/dist/src/views/errors/getCollectionResponse.404.njk +5 -0
- package/dist/src/views/errors/getEnvironment.404.njk +5 -0
- package/dist/src/views/errors/getMock.404.njk +5 -0
- package/dist/src/views/errors/getMonitor.404.njk +5 -0
- package/dist/src/views/errors/getSpec.404.njk +5 -0
- package/dist/src/views/errors/getWorkspace.404.njk +5 -0
- package/dist/src/views/getWorkspaces.njk +3 -3
- package/package.json +24 -24
- package/dist/src/tools/deletePanElementOrFolder.js +0 -41
- package/dist/src/tools/postPanElementOrFolder.js +0 -84
- package/dist/src/tools/updatePanElementOrFolder.js +0 -100
|
@@ -9,8 +9,11 @@ export const parameters = z.object({
|
|
|
9
9
|
.string()
|
|
10
10
|
.describe('The folder ID in which to create the request. By default, the system will create the request at the collection level.')
|
|
11
11
|
.optional(),
|
|
12
|
-
name: z
|
|
13
|
-
|
|
12
|
+
name: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe("The request's name. It is recommended that you pass the `name` property in the request body. If you do not, the system uses a null value. As a result, this creates a request with a blank name.")
|
|
15
|
+
.optional(),
|
|
16
|
+
description: z.string().nullable().describe("The request's description.").optional(),
|
|
14
17
|
method: z
|
|
15
18
|
.enum([
|
|
16
19
|
'GET',
|
|
@@ -29,56 +32,81 @@ export const parameters = z.object({
|
|
|
29
32
|
'PROPFIND',
|
|
30
33
|
'VIEW',
|
|
31
34
|
])
|
|
32
|
-
.
|
|
35
|
+
.describe("The request's HTTP method.")
|
|
33
36
|
.optional(),
|
|
34
|
-
url: z.string().nullable().optional(),
|
|
37
|
+
url: z.string().nullable().describe("The request's URL.").optional(),
|
|
35
38
|
headerData: z
|
|
36
39
|
.array(z.object({
|
|
37
|
-
key: z.string().optional(),
|
|
38
|
-
value: z.string().optional(),
|
|
39
|
-
description: z.string().
|
|
40
|
+
key: z.string().describe("The header's key.").optional(),
|
|
41
|
+
value: z.string().describe("The header's value.").optional(),
|
|
42
|
+
description: z.string().describe("The header's description.").optional(),
|
|
40
43
|
}))
|
|
44
|
+
.describe("The request's headers.")
|
|
41
45
|
.optional(),
|
|
42
46
|
queryParams: z
|
|
43
47
|
.array(z.object({
|
|
44
|
-
key: z.string().optional(),
|
|
45
|
-
value: z.string().optional(),
|
|
46
|
-
description: z.string().
|
|
47
|
-
enabled: z.boolean().optional(),
|
|
48
|
+
key: z.string().describe("The query parameter's key.").optional(),
|
|
49
|
+
value: z.string().describe("The query parameter's value.").optional(),
|
|
50
|
+
description: z.string().describe("The query parameter's description.").optional(),
|
|
51
|
+
enabled: z.boolean().describe('If true, the query parameter is enabled.').optional(),
|
|
48
52
|
}))
|
|
53
|
+
.describe("The request's query parameters.")
|
|
54
|
+
.optional(),
|
|
55
|
+
dataMode: z
|
|
56
|
+
.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql'])
|
|
57
|
+
.describe("The request body's data mode.")
|
|
49
58
|
.optional(),
|
|
50
|
-
dataMode: z.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql']).nullable().optional(),
|
|
51
59
|
data: z
|
|
52
60
|
.array(z.object({
|
|
53
|
-
key: z.string().optional(),
|
|
54
|
-
value: z.string().optional(),
|
|
55
|
-
description: z.string().
|
|
56
|
-
enabled: z.boolean().optional(),
|
|
57
|
-
type: z.enum(['text', 'file']).optional(),
|
|
58
|
-
uuid: z.string().optional(),
|
|
61
|
+
key: z.string().describe("The form data's key.").optional(),
|
|
62
|
+
value: z.string().describe("The form data's value.").optional(),
|
|
63
|
+
description: z.string().describe("The form data's description.").optional(),
|
|
64
|
+
enabled: z.boolean().describe('If true, the form data entry is enabled.').optional(),
|
|
65
|
+
type: z.enum(['text', 'file']).describe("The form data's type.").optional(),
|
|
66
|
+
uuid: z.string().describe("The form data entry's unique identifier.").optional(),
|
|
59
67
|
}))
|
|
60
68
|
.nullable()
|
|
69
|
+
.describe("The request body's form data.")
|
|
61
70
|
.optional(),
|
|
62
|
-
rawModeData: z.string().nullable().optional(),
|
|
71
|
+
rawModeData: z.string().nullable().describe("The request body's raw mode data.").optional(),
|
|
63
72
|
graphqlModeData: z
|
|
64
|
-
.object({
|
|
73
|
+
.object({
|
|
74
|
+
query: z.string().describe('The GraphQL query.').optional(),
|
|
75
|
+
variables: z.string().describe('The GraphQL query variables, in JSON format.').optional(),
|
|
76
|
+
})
|
|
65
77
|
.nullable()
|
|
78
|
+
.describe("The request body's GraphQL mode data.")
|
|
66
79
|
.optional(),
|
|
67
80
|
dataOptions: z
|
|
68
81
|
.object({
|
|
69
|
-
raw: z
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
raw: z
|
|
83
|
+
.object({ language: z.string().describe("The raw mode data's language type.").optional() })
|
|
84
|
+
.describe('Options for the `raw` data mode.')
|
|
85
|
+
.optional(),
|
|
86
|
+
urlencoded: z
|
|
87
|
+
.record(z.string(), z.unknown())
|
|
88
|
+
.describe('Options for the `urlencoded` data mode.')
|
|
89
|
+
.optional(),
|
|
90
|
+
params: z
|
|
91
|
+
.record(z.string(), z.unknown())
|
|
92
|
+
.describe('Options for the `params` data mode.')
|
|
93
|
+
.optional(),
|
|
94
|
+
binary: z
|
|
95
|
+
.record(z.string(), z.unknown())
|
|
96
|
+
.describe('Options for the `binary` data mode.')
|
|
97
|
+
.optional(),
|
|
98
|
+
graphql: z
|
|
99
|
+
.record(z.string(), z.unknown())
|
|
100
|
+
.describe('Options for the `graphql` data mode.')
|
|
101
|
+
.optional(),
|
|
74
102
|
})
|
|
75
103
|
.nullable()
|
|
104
|
+
.describe("Additional configurations and options set for the request body's various data modes.")
|
|
76
105
|
.optional(),
|
|
77
106
|
auth: z
|
|
78
107
|
.object({
|
|
79
108
|
type: z
|
|
80
109
|
.enum([
|
|
81
|
-
'noauth',
|
|
82
110
|
'basic',
|
|
83
111
|
'bearer',
|
|
84
112
|
'apikey',
|
|
@@ -91,94 +119,225 @@ export const parameters = z.object({
|
|
|
91
119
|
'edgegrid',
|
|
92
120
|
'jwt',
|
|
93
121
|
'asap',
|
|
122
|
+
'noauth',
|
|
94
123
|
])
|
|
95
|
-
.
|
|
124
|
+
.describe('The authorization type.'),
|
|
96
125
|
apikey: z
|
|
97
|
-
.array(z
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
.array(z
|
|
127
|
+
.object({
|
|
128
|
+
key: z.string().describe("The auth method's key value."),
|
|
129
|
+
value: z
|
|
130
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
131
|
+
.describe("The key's value.")
|
|
132
|
+
.optional(),
|
|
133
|
+
type: z
|
|
134
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
135
|
+
.describe("The value's type.")
|
|
136
|
+
.optional(),
|
|
137
|
+
})
|
|
138
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
139
|
+
.describe("The API key's authentication information.")
|
|
102
140
|
.optional(),
|
|
103
|
-
|
|
104
|
-
.array(z
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
141
|
+
awsv4: z
|
|
142
|
+
.array(z
|
|
143
|
+
.object({
|
|
144
|
+
key: z.string().describe("The auth method's key value."),
|
|
145
|
+
value: z
|
|
146
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
147
|
+
.describe("The key's value.")
|
|
148
|
+
.optional(),
|
|
149
|
+
type: z
|
|
150
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
151
|
+
.describe("The value's type.")
|
|
152
|
+
.optional(),
|
|
153
|
+
})
|
|
154
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
155
|
+
.describe('The attributes for AWS Signature authentication.')
|
|
109
156
|
.optional(),
|
|
110
157
|
basic: z
|
|
111
|
-
.array(z
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
158
|
+
.array(z
|
|
159
|
+
.object({
|
|
160
|
+
key: z.string().describe("The auth method's key value."),
|
|
161
|
+
value: z
|
|
162
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
163
|
+
.describe("The key's value.")
|
|
164
|
+
.optional(),
|
|
165
|
+
type: z
|
|
166
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
167
|
+
.describe("The value's type.")
|
|
168
|
+
.optional(),
|
|
169
|
+
})
|
|
170
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
171
|
+
.describe('The attributes for Basic Auth.')
|
|
116
172
|
.optional(),
|
|
117
|
-
|
|
118
|
-
.array(z
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
173
|
+
bearer: z
|
|
174
|
+
.array(z
|
|
175
|
+
.object({
|
|
176
|
+
key: z.string().describe("The auth method's key value."),
|
|
177
|
+
value: z
|
|
178
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
179
|
+
.describe("The key's value.")
|
|
180
|
+
.optional(),
|
|
181
|
+
type: z
|
|
182
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
183
|
+
.describe("The value's type.")
|
|
184
|
+
.optional(),
|
|
185
|
+
})
|
|
186
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
187
|
+
.describe('The attributes for Bearer Token authentication.')
|
|
123
188
|
.optional(),
|
|
124
|
-
|
|
125
|
-
.array(z
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
189
|
+
digest: z
|
|
190
|
+
.array(z
|
|
191
|
+
.object({
|
|
192
|
+
key: z.string().describe("The auth method's key value."),
|
|
193
|
+
value: z
|
|
194
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
195
|
+
.describe("The key's value.")
|
|
196
|
+
.optional(),
|
|
197
|
+
type: z
|
|
198
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
199
|
+
.describe("The value's type.")
|
|
200
|
+
.optional(),
|
|
201
|
+
})
|
|
202
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
203
|
+
.describe('The attributes for Digest access authentication.')
|
|
130
204
|
.optional(),
|
|
131
|
-
|
|
132
|
-
.array(z
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
205
|
+
edgegrid: z
|
|
206
|
+
.array(z
|
|
207
|
+
.object({
|
|
208
|
+
key: z.string().describe("The auth method's key value."),
|
|
209
|
+
value: z
|
|
210
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
211
|
+
.describe("The key's value.")
|
|
212
|
+
.optional(),
|
|
213
|
+
type: z
|
|
214
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
215
|
+
.describe("The value's type.")
|
|
216
|
+
.optional(),
|
|
217
|
+
})
|
|
218
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
219
|
+
.describe('The attributes for Akamai Edgegrid authentication.')
|
|
137
220
|
.optional(),
|
|
138
221
|
hawk: z
|
|
139
|
-
.array(z
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
})
|
|
222
|
+
.array(z
|
|
223
|
+
.object({
|
|
224
|
+
key: z.string().describe("The auth method's key value."),
|
|
225
|
+
value: z
|
|
226
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
227
|
+
.describe("The key's value.")
|
|
228
|
+
.optional(),
|
|
229
|
+
type: z
|
|
230
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
231
|
+
.describe("The value's type.")
|
|
232
|
+
.optional(),
|
|
233
|
+
})
|
|
234
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
235
|
+
.describe('The attributes for Hawk authentication.')
|
|
151
236
|
.optional(),
|
|
152
237
|
ntlm: z
|
|
153
|
-
.array(z
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
238
|
+
.array(z
|
|
239
|
+
.object({
|
|
240
|
+
key: z.string().describe("The auth method's key value."),
|
|
241
|
+
value: z
|
|
242
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
243
|
+
.describe("The key's value.")
|
|
244
|
+
.optional(),
|
|
245
|
+
type: z
|
|
246
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
247
|
+
.describe("The value's type.")
|
|
248
|
+
.optional(),
|
|
249
|
+
})
|
|
250
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
251
|
+
.describe('The attributes for NTLM authentication.')
|
|
158
252
|
.optional(),
|
|
159
|
-
|
|
160
|
-
.array(z
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
253
|
+
oauth1: z
|
|
254
|
+
.array(z
|
|
255
|
+
.object({
|
|
256
|
+
key: z.string().describe("The auth method's key value."),
|
|
257
|
+
value: z
|
|
258
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
259
|
+
.describe("The key's value.")
|
|
260
|
+
.optional(),
|
|
261
|
+
type: z
|
|
262
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
263
|
+
.describe("The value's type.")
|
|
264
|
+
.optional(),
|
|
265
|
+
})
|
|
266
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
267
|
+
.describe('The attributes for OAuth1 authentication.')
|
|
268
|
+
.optional(),
|
|
269
|
+
oauth2: z
|
|
270
|
+
.array(z
|
|
271
|
+
.object({
|
|
272
|
+
key: z.string().describe("The auth method's key value."),
|
|
273
|
+
value: z
|
|
274
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
275
|
+
.describe("The key's value.")
|
|
276
|
+
.optional(),
|
|
277
|
+
type: z
|
|
278
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
279
|
+
.describe("The value's type.")
|
|
280
|
+
.optional(),
|
|
281
|
+
})
|
|
282
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
283
|
+
.describe('The attributes for OAuth2 authentication.')
|
|
165
284
|
.optional(),
|
|
166
285
|
jwt: z
|
|
167
|
-
.array(z
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
286
|
+
.array(z
|
|
287
|
+
.object({
|
|
288
|
+
key: z.string().describe("The auth method's key value."),
|
|
289
|
+
value: z
|
|
290
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
291
|
+
.describe("The key's value.")
|
|
292
|
+
.optional(),
|
|
293
|
+
type: z
|
|
294
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
295
|
+
.describe("The value's type.")
|
|
296
|
+
.optional(),
|
|
297
|
+
})
|
|
298
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
299
|
+
.describe('The attributes for JWT authentication.')
|
|
172
300
|
.optional(),
|
|
173
301
|
asap: z
|
|
174
|
-
.array(z
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
302
|
+
.array(z
|
|
303
|
+
.object({
|
|
304
|
+
key: z.string().describe("The auth method's key value."),
|
|
305
|
+
value: z
|
|
306
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
307
|
+
.describe("The key's value.")
|
|
308
|
+
.optional(),
|
|
309
|
+
type: z
|
|
310
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
311
|
+
.describe("The value's type.")
|
|
312
|
+
.optional(),
|
|
313
|
+
})
|
|
314
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
315
|
+
.describe('The attributes for ASAP authentication.')
|
|
179
316
|
.optional(),
|
|
180
317
|
})
|
|
181
318
|
.nullable()
|
|
319
|
+
.describe("The request's authentication information.")
|
|
320
|
+
.optional(),
|
|
321
|
+
events: z
|
|
322
|
+
.array(z.object({
|
|
323
|
+
listen: z.enum(['test', 'prerequest']).describe('The event type.').optional(),
|
|
324
|
+
script: z
|
|
325
|
+
.object({
|
|
326
|
+
id: z.string().describe("The script's ID.").optional(),
|
|
327
|
+
type: z
|
|
328
|
+
.string()
|
|
329
|
+
.describe('The type of script. For example, `text/javascript`.')
|
|
330
|
+
.optional(),
|
|
331
|
+
exec: z
|
|
332
|
+
.array(z.string().nullable())
|
|
333
|
+
.describe('A list of script strings, where each line represents a line of code. Separate lines makes it easy to track script changes.')
|
|
334
|
+
.optional(),
|
|
335
|
+
})
|
|
336
|
+
.describe('Information about the Javascript code that can be used to to perform setup or teardown operations in a response.')
|
|
337
|
+
.optional(),
|
|
338
|
+
}))
|
|
339
|
+
.nullable()
|
|
340
|
+
.describe('A list of scripts configured to run when specific events occur.')
|
|
182
341
|
.optional(),
|
|
183
342
|
});
|
|
184
343
|
export const annotations = {
|
|
@@ -219,6 +378,8 @@ export async function handler(args, extra) {
|
|
|
219
378
|
bodyPayload.dataOptions = args.dataOptions;
|
|
220
379
|
if (args.auth !== undefined)
|
|
221
380
|
bodyPayload.auth = args.auth;
|
|
381
|
+
if (args.events !== undefined)
|
|
382
|
+
bodyPayload.events = args.events;
|
|
222
383
|
const options = {
|
|
223
384
|
body: JSON.stringify(bodyPayload),
|
|
224
385
|
contentType: ContentType.Json,
|
|
@@ -5,11 +5,101 @@ export const method = 'createCollectionResponse';
|
|
|
5
5
|
export const description = 'Creates a request response in a collection. For a complete list of request body properties, refer to the **Response** 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\nIt is recommended that you pass the \\`name\\` property in the request body. If you do not, the system uses a null value. As a result, this creates a response with a blank name.\n';
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
collectionId: z.string().describe("The collection's ID."),
|
|
8
|
-
|
|
8
|
+
request: z.string().describe("The parent request's ID."),
|
|
9
9
|
name: z
|
|
10
10
|
.string()
|
|
11
11
|
.describe("The response's name. It is recommended that you pass the `name` property in the request body. If you do not, the system uses a null value. As a result, this creates a response with a blank name.")
|
|
12
12
|
.optional(),
|
|
13
|
+
description: z.string().nullable().describe("The response's description.").optional(),
|
|
14
|
+
url: z.string().nullable().describe("The associated request's URL.").optional(),
|
|
15
|
+
method: z
|
|
16
|
+
.enum([
|
|
17
|
+
'GET',
|
|
18
|
+
'PUT',
|
|
19
|
+
'POST',
|
|
20
|
+
'PATCH',
|
|
21
|
+
'DELETE',
|
|
22
|
+
'COPY',
|
|
23
|
+
'HEAD',
|
|
24
|
+
'OPTIONS',
|
|
25
|
+
'LINK',
|
|
26
|
+
'UNLINK',
|
|
27
|
+
'PURGE',
|
|
28
|
+
'LOCK',
|
|
29
|
+
'UNLOCK',
|
|
30
|
+
'PROPFIND',
|
|
31
|
+
'VIEW',
|
|
32
|
+
])
|
|
33
|
+
.describe("The request's HTTP method.")
|
|
34
|
+
.optional(),
|
|
35
|
+
headers: z
|
|
36
|
+
.array(z
|
|
37
|
+
.object({
|
|
38
|
+
key: z
|
|
39
|
+
.string()
|
|
40
|
+
.describe("The header's key, such as `Content-Type` or `X-Custom-Header`."),
|
|
41
|
+
value: z.string().describe("The header key's value."),
|
|
42
|
+
description: z.string().nullable().describe("The header's description.").optional(),
|
|
43
|
+
})
|
|
44
|
+
.describe('Information about the header.'))
|
|
45
|
+
.describe('A list of headers.')
|
|
46
|
+
.optional(),
|
|
47
|
+
dataMode: z
|
|
48
|
+
.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql'])
|
|
49
|
+
.describe("The associated request body's data mode.")
|
|
50
|
+
.optional(),
|
|
51
|
+
rawModeData: z
|
|
52
|
+
.string()
|
|
53
|
+
.nullable()
|
|
54
|
+
.describe("The associated request body's raw mode data.")
|
|
55
|
+
.optional(),
|
|
56
|
+
dataOptions: z
|
|
57
|
+
.object({
|
|
58
|
+
raw: z
|
|
59
|
+
.object({ language: z.string().describe("The raw mode data's language type.").optional() })
|
|
60
|
+
.describe('Options for the `raw` data mode.')
|
|
61
|
+
.optional(),
|
|
62
|
+
urlencoded: z
|
|
63
|
+
.record(z.string(), z.unknown())
|
|
64
|
+
.describe('Options for the `urlencoded` data mode.')
|
|
65
|
+
.optional(),
|
|
66
|
+
params: z
|
|
67
|
+
.record(z.string(), z.unknown())
|
|
68
|
+
.describe('Options for the `params` data mode.')
|
|
69
|
+
.optional(),
|
|
70
|
+
binary: z
|
|
71
|
+
.record(z.string(), z.unknown())
|
|
72
|
+
.describe('Options for the `binary` data mode.')
|
|
73
|
+
.optional(),
|
|
74
|
+
graphql: z
|
|
75
|
+
.record(z.string(), z.unknown())
|
|
76
|
+
.describe('Options for the `graphql` data mode.')
|
|
77
|
+
.optional(),
|
|
78
|
+
})
|
|
79
|
+
.nullable()
|
|
80
|
+
.describe("Additional configurations and options set for the request body's various data modes.")
|
|
81
|
+
.optional(),
|
|
82
|
+
responseCode: z
|
|
83
|
+
.object({
|
|
84
|
+
code: z.number().describe("The response's HTTP response status code.").optional(),
|
|
85
|
+
name: z.string().describe('The name of the status code.').optional(),
|
|
86
|
+
})
|
|
87
|
+
.describe("The response's HTTP response code information.")
|
|
88
|
+
.optional(),
|
|
89
|
+
status: z.string().nullable().describe("The response's HTTP status text.").optional(),
|
|
90
|
+
time: z
|
|
91
|
+
.string()
|
|
92
|
+
.describe('The time taken by the request to complete, in milliseconds.')
|
|
93
|
+
.optional(),
|
|
94
|
+
cookies: z.string().nullable().describe("The response's cookie data.").optional(),
|
|
95
|
+
mime: z.string().nullable().describe("The response's MIME type.").optional(),
|
|
96
|
+
text: z.string().describe('The raw text of the response body.').optional(),
|
|
97
|
+
language: z.string().describe("The response body's language type.").optional(),
|
|
98
|
+
rawDataType: z.string().nullable().describe("The response's raw data type.").optional(),
|
|
99
|
+
requestObject: z
|
|
100
|
+
.string()
|
|
101
|
+
.describe('A JSON-stringified representation of the associated request.')
|
|
102
|
+
.optional(),
|
|
13
103
|
});
|
|
14
104
|
export const annotations = {
|
|
15
105
|
title: 'Creates a request response in a collection. For a complete list of request body properties, refer to the **Response** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).',
|
|
@@ -21,12 +111,44 @@ export async function handler(args, extra) {
|
|
|
21
111
|
try {
|
|
22
112
|
const endpoint = `/collections/${args.collectionId}/responses`;
|
|
23
113
|
const query = new URLSearchParams();
|
|
24
|
-
if (args.
|
|
25
|
-
query.set('
|
|
114
|
+
if (args.request !== undefined)
|
|
115
|
+
query.set('request', String(args.request));
|
|
26
116
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
27
117
|
const bodyPayload = {};
|
|
28
118
|
if (args.name !== undefined)
|
|
29
119
|
bodyPayload.name = args.name;
|
|
120
|
+
if (args.description !== undefined)
|
|
121
|
+
bodyPayload.description = args.description;
|
|
122
|
+
if (args.url !== undefined)
|
|
123
|
+
bodyPayload.url = args.url;
|
|
124
|
+
if (args.method !== undefined)
|
|
125
|
+
bodyPayload.method = args.method;
|
|
126
|
+
if (args.headers !== undefined)
|
|
127
|
+
bodyPayload.headers = args.headers;
|
|
128
|
+
if (args.dataMode !== undefined)
|
|
129
|
+
bodyPayload.dataMode = args.dataMode;
|
|
130
|
+
if (args.rawModeData !== undefined)
|
|
131
|
+
bodyPayload.rawModeData = args.rawModeData;
|
|
132
|
+
if (args.dataOptions !== undefined)
|
|
133
|
+
bodyPayload.dataOptions = args.dataOptions;
|
|
134
|
+
if (args.responseCode !== undefined)
|
|
135
|
+
bodyPayload.responseCode = args.responseCode;
|
|
136
|
+
if (args.status !== undefined)
|
|
137
|
+
bodyPayload.status = args.status;
|
|
138
|
+
if (args.time !== undefined)
|
|
139
|
+
bodyPayload.time = args.time;
|
|
140
|
+
if (args.cookies !== undefined)
|
|
141
|
+
bodyPayload.cookies = args.cookies;
|
|
142
|
+
if (args.mime !== undefined)
|
|
143
|
+
bodyPayload.mime = args.mime;
|
|
144
|
+
if (args.text !== undefined)
|
|
145
|
+
bodyPayload.text = args.text;
|
|
146
|
+
if (args.language !== undefined)
|
|
147
|
+
bodyPayload.language = args.language;
|
|
148
|
+
if (args.rawDataType !== undefined)
|
|
149
|
+
bodyPayload.rawDataType = args.rawDataType;
|
|
150
|
+
if (args.requestObject !== undefined)
|
|
151
|
+
bodyPayload.requestObject = args.requestObject;
|
|
30
152
|
const options = {
|
|
31
153
|
body: JSON.stringify(bodyPayload),
|
|
32
154
|
contentType: ContentType.Json,
|
|
@@ -2,24 +2,36 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
3
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
4
|
export const method = 'createSpec';
|
|
5
|
-
export const description = "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,
|
|
5
|
+
export const description = "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, AsyncAPI 2.0, protobuf 2 and 3, and GraphQL 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";
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
workspaceId: z.string().describe("The workspace's ID."),
|
|
8
8
|
name: z.string().describe("The specification's name."),
|
|
9
9
|
type: z
|
|
10
|
-
.enum([
|
|
10
|
+
.enum([
|
|
11
|
+
'OPENAPI:2.0',
|
|
12
|
+
'OPENAPI:3.0',
|
|
13
|
+
'OPENAPI:3.1',
|
|
14
|
+
'ASYNCAPI:2.0',
|
|
15
|
+
'PROTOBUF:2',
|
|
16
|
+
'PROTOBUF:3',
|
|
17
|
+
'GRAPHQL',
|
|
18
|
+
])
|
|
11
19
|
.describe("The specification's type."),
|
|
12
20
|
files: z
|
|
13
21
|
.array(z.union([
|
|
14
22
|
z.object({
|
|
15
|
-
path: z
|
|
23
|
+
path: z
|
|
24
|
+
.string()
|
|
25
|
+
.describe("The file's path. Accepts .json, .yaml, .proto and .graphql file types."),
|
|
16
26
|
content: z.string().describe("The file's stringified contents."),
|
|
17
27
|
type: z
|
|
18
28
|
.enum(['DEFAULT', 'ROOT'])
|
|
19
29
|
.describe('The type of file. This property is required when creating multi-file specifications:\n- `ROOT` — The file containing the full OpenAPI structure. This serves as the entry point for the API spec and references other (`DEFAULT`) spec files. Multi-file specs can only have one root file.\n- `DEFAULT` — A file referenced by the `ROOT` file.\n'),
|
|
20
30
|
}),
|
|
21
31
|
z.object({
|
|
22
|
-
path: z
|
|
32
|
+
path: z
|
|
33
|
+
.string()
|
|
34
|
+
.describe("The file's path. Accepts .json, .yaml, .proto and .graphql file types."),
|
|
23
35
|
content: z.string().describe("The file's stringified contents."),
|
|
24
36
|
}),
|
|
25
37
|
]))
|
|
@@ -2,16 +2,20 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
3
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
4
|
export const method = 'createWorkspace';
|
|
5
|
-
export const description = '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-
|
|
5
|
+
export const description = '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- Private and [Partner Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing).\n- There are rate limits when publishing public workspaces.\n- Public team workspace names must be unique.\n- The \\`teamId\\` property must be passed in the request body if [Postman Organizations](https://learning.postman.com/docs/administration/onboarding-checklist) is enabled.\n';
|
|
6
6
|
export const parameters = z.object({
|
|
7
7
|
workspace: z
|
|
8
8
|
.object({
|
|
9
9
|
name: z.string().describe("The workspace's name."),
|
|
10
10
|
type: z
|
|
11
11
|
.enum(['personal', 'private', 'public', 'team', 'partner'])
|
|
12
|
-
.describe('The type of workspace:\n- `personal`\n- `private` — Private workspaces are available on Postman [**
|
|
12
|
+
.describe('The type of workspace:\n- `personal`\n- `private` — Private workspaces are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing).\n- `public`\n- `team`\n- `partner` — [Partner Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing)).\n'),
|
|
13
13
|
description: z.string().describe("The workspace's description.").optional(),
|
|
14
14
|
about: z.string().describe('A brief summary about the workspace.').optional(),
|
|
15
|
+
teamId: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('The team ID to assign to the workspace. This property is required if Postman [Organizations](https://learning.postman.com/docs/administration/managing-your-team/overview) is enabled.')
|
|
18
|
+
.optional(),
|
|
15
19
|
})
|
|
16
20
|
.describe('Information about the workspace.')
|
|
17
21
|
.optional(),
|