@postman/postman-mcp-server 2.2.1 → 2.3.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/dist/package.json +18 -18
- package/dist/src/clients/postman.js +25 -15
- package/dist/src/index.js +38 -50
- package/dist/src/tools/createCollection.js +13 -17
- package/dist/src/tools/createCollectionComment.js +9 -9
- package/dist/src/tools/createCollectionFolder.js +7 -7
- package/dist/src/tools/createCollectionFork.js +7 -7
- package/dist/src/tools/createCollectionRequest.js +7 -7
- package/dist/src/tools/createCollectionResponse.js +7 -7
- package/dist/src/tools/createEnvironment.js +6 -6
- package/dist/src/tools/createFolderComment.js +9 -9
- package/dist/src/tools/createMock.js +8 -8
- package/dist/src/tools/createMonitor.js +6 -6
- package/dist/src/tools/createRequestComment.js +9 -9
- package/dist/src/tools/createResponseComment.js +9 -9
- package/dist/src/tools/createSpec.js +10 -10
- package/dist/src/tools/createSpecFile.js +7 -7
- package/dist/src/tools/createWorkspace.js +4 -4
- package/dist/src/tools/deleteApiCollectionComment.js +3 -3
- package/dist/src/tools/deleteCollection.js +3 -3
- package/dist/src/tools/deleteCollectionComment.js +3 -3
- package/dist/src/tools/deleteCollectionFolder.js +3 -3
- package/dist/src/tools/deleteCollectionRequest.js +3 -3
- package/dist/src/tools/deleteCollectionResponse.js +3 -3
- package/dist/src/tools/deleteEnvironment.js +3 -3
- package/dist/src/tools/deleteFolderComment.js +3 -3
- package/dist/src/tools/deleteMock.js +5 -5
- package/dist/src/tools/deleteMonitor.js +3 -3
- package/dist/src/tools/deletePanElementOrFolder.js +3 -3
- package/dist/src/tools/deleteRequestComment.js +3 -3
- package/dist/src/tools/deleteResponseComment.js +3 -3
- package/dist/src/tools/deleteSpec.js +3 -3
- package/dist/src/tools/deleteSpecFile.js +3 -3
- package/dist/src/tools/deleteWorkspace.js +3 -3
- package/dist/src/tools/duplicateCollection.js +7 -7
- package/dist/src/tools/generateCollection.js +11 -11
- package/dist/src/tools/generateSpecFromCollection.js +9 -9
- package/dist/src/tools/getAllElementsAndFolders.js +28 -28
- package/dist/src/tools/getAllPanAddElementRequests.js +22 -22
- package/dist/src/tools/getAllSpecs.js +8 -8
- package/dist/src/tools/getAsyncSpecTaskStatus.js +3 -3
- package/dist/src/tools/getAuthenticatedUser.js +4 -4
- package/dist/src/tools/getCollection.js +7 -7
- package/dist/src/tools/getCollectionComments.js +3 -3
- package/dist/src/tools/getCollectionFolder.js +9 -9
- package/dist/src/tools/getCollectionForks.js +9 -9
- package/dist/src/tools/getCollectionRequest.js +9 -9
- package/dist/src/tools/getCollectionResponse.js +9 -9
- package/dist/src/tools/getCollectionTags.js +3 -3
- package/dist/src/tools/getCollectionUpdatesTasks.js +3 -3
- package/dist/src/tools/getCollections.js +10 -10
- package/dist/src/tools/getCollectionsForkedByUser.js +8 -8
- package/dist/src/tools/getDuplicateCollectionTaskStatus.js +3 -3
- package/dist/src/tools/getEnvironment.js +3 -3
- package/dist/src/tools/getEnvironments.js +4 -4
- package/dist/src/tools/getFolderComments.js +3 -3
- package/dist/src/tools/getGeneratedCollectionSpecs.js +3 -3
- package/dist/src/tools/getMock.js +5 -5
- package/dist/src/tools/getMocks.js +16 -10
- package/dist/src/tools/getMonitor.js +3 -3
- package/dist/src/tools/getMonitors.js +16 -16
- package/dist/src/tools/getRequestComments.js +3 -3
- package/dist/src/tools/getResponseComments.js +3 -3
- package/dist/src/tools/getSourceCollectionStatus.js +3 -3
- package/dist/src/tools/getSpec.js +3 -3
- package/dist/src/tools/getSpecCollections.js +7 -7
- package/dist/src/tools/getSpecDefinition.js +3 -3
- package/dist/src/tools/getSpecFile.js +3 -3
- package/dist/src/tools/getSpecFiles.js +3 -3
- package/dist/src/tools/getStatusOfAnAsyncApiTask.js +3 -3
- package/dist/src/tools/getTaggedEntities.js +11 -11
- package/dist/src/tools/getWorkspace.js +5 -5
- package/dist/src/tools/getWorkspaceGlobalVariables.js +3 -3
- package/dist/src/tools/getWorkspaceTags.js +3 -3
- package/dist/src/tools/getWorkspaces.js +12 -12
- package/dist/src/tools/mergeCollectionFork.js +8 -8
- package/dist/src/tools/patchCollection.js +5 -5
- package/dist/src/tools/patchEnvironment.js +50 -4
- package/dist/src/tools/postPanElementOrFolder.js +51 -3
- package/dist/src/tools/publishDocumentation.js +11 -11
- package/dist/src/tools/publishMock.js +3 -3
- package/dist/src/tools/pullCollectionChanges.js +3 -3
- package/dist/src/tools/putCollection.js +13 -17
- package/dist/src/tools/putEnvironment.js +5 -5
- package/dist/src/tools/resolveCommentThread.js +3 -3
- package/dist/src/tools/runMonitor.js +5 -5
- package/dist/src/tools/syncCollectionWithSpec.js +5 -5
- package/dist/src/tools/syncSpecWithCollection.js +5 -5
- package/dist/src/tools/transferCollectionFolders.js +10 -10
- package/dist/src/tools/transferCollectionRequests.js +10 -10
- package/dist/src/tools/transferCollectionResponses.js +10 -10
- package/dist/src/tools/unpublishDocumentation.js +3 -3
- package/dist/src/tools/unpublishMock.js +3 -3
- package/dist/src/tools/updateApiCollectionComment.js +7 -7
- package/dist/src/tools/updateCollectionComment.js +7 -7
- package/dist/src/tools/updateCollectionFolder.js +7 -7
- package/dist/src/tools/updateCollectionRequest.js +7 -7
- package/dist/src/tools/updateCollectionResponse.js +7 -7
- package/dist/src/tools/updateCollectionTags.js +5 -5
- package/dist/src/tools/updateFolderComment.js +7 -7
- package/dist/src/tools/updateMock.js +7 -7
- package/dist/src/tools/updateMonitor.js +5 -5
- package/dist/src/tools/updatePanElementOrFolder.js +62 -3
- package/dist/src/tools/updateRequestComment.js +7 -7
- package/dist/src/tools/updateResponseComment.js +7 -7
- package/dist/src/tools/updateSpecFile.js +9 -9
- package/dist/src/tools/updateSpecProperties.js +5 -5
- package/dist/src/tools/updateWorkspace.js +5 -5
- package/dist/src/tools/updateWorkspaceGlobalVariables.js +5 -5
- package/dist/src/tools/updateWorkspaceTags.js +5 -5
- package/package.json +18 -18
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
6
6
|
}
|
|
7
7
|
export const method = 'getMocks';
|
|
8
|
-
export const description = 'Gets all active mock servers. By default,
|
|
8
|
+
export const description = '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';
|
|
9
9
|
export const parameters = z.object({
|
|
10
|
-
teamId: z
|
|
11
|
-
|
|
10
|
+
teamId: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Return only results that belong to the given team ID.\n- For team-scoped requests, set this from GET `/me` (`me.teamId`).\n')
|
|
13
|
+
.optional(),
|
|
14
|
+
workspace: z
|
|
15
|
+
.string()
|
|
16
|
+
.describe('Return only results found in the given workspace ID.\n- Prefer this parameter when the user mentions a specific workspace.\n')
|
|
17
|
+
.optional(),
|
|
12
18
|
});
|
|
13
19
|
export const annotations = {
|
|
14
|
-
title: 'Gets all active mock servers. By default,
|
|
20
|
+
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',
|
|
15
21
|
readOnlyHint: true,
|
|
16
22
|
destructiveHint: false,
|
|
17
23
|
idempotentHint: true,
|
|
18
24
|
};
|
|
19
|
-
export async function handler(
|
|
25
|
+
export async function handler(args, extra) {
|
|
20
26
|
try {
|
|
21
27
|
const endpoint = `/mocks`;
|
|
22
28
|
const query = new URLSearchParams();
|
|
23
|
-
if (
|
|
24
|
-
query.set('teamId', String(
|
|
25
|
-
if (
|
|
26
|
-
query.set('workspace', String(
|
|
29
|
+
if (args.teamId !== undefined)
|
|
30
|
+
query.set('teamId', String(args.teamId));
|
|
31
|
+
if (args.workspace !== undefined)
|
|
32
|
+
query.set('workspace', String(args.workspace));
|
|
27
33
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
28
34
|
const options = {
|
|
29
35
|
headers: extra.headers,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/monitors/${
|
|
18
|
+
const endpoint = `/monitors/${args.monitorId}`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -35,24 +35,24 @@ export const annotations = {
|
|
|
35
35
|
destructiveHint: false,
|
|
36
36
|
idempotentHint: true,
|
|
37
37
|
};
|
|
38
|
-
export async function handler(
|
|
38
|
+
export async function handler(args, extra) {
|
|
39
39
|
try {
|
|
40
40
|
const endpoint = `/monitors`;
|
|
41
41
|
const query = new URLSearchParams();
|
|
42
|
-
if (
|
|
43
|
-
query.set('workspace', String(
|
|
44
|
-
if (
|
|
45
|
-
query.set('active', String(
|
|
46
|
-
if (
|
|
47
|
-
query.set('owner', String(
|
|
48
|
-
if (
|
|
49
|
-
query.set('collectionUid', String(
|
|
50
|
-
if (
|
|
51
|
-
query.set('environmentUid', String(
|
|
52
|
-
if (
|
|
53
|
-
query.set('cursor', String(
|
|
54
|
-
if (
|
|
55
|
-
query.set('limit', String(
|
|
42
|
+
if (args.workspace !== undefined)
|
|
43
|
+
query.set('workspace', String(args.workspace));
|
|
44
|
+
if (args.active !== undefined)
|
|
45
|
+
query.set('active', String(args.active));
|
|
46
|
+
if (args.owner !== undefined)
|
|
47
|
+
query.set('owner', String(args.owner));
|
|
48
|
+
if (args.collectionUid !== undefined)
|
|
49
|
+
query.set('collectionUid', String(args.collectionUid));
|
|
50
|
+
if (args.environmentUid !== undefined)
|
|
51
|
+
query.set('environmentUid', String(args.environmentUid));
|
|
52
|
+
if (args.cursor !== undefined)
|
|
53
|
+
query.set('cursor', String(args.cursor));
|
|
54
|
+
if (args.limit !== undefined)
|
|
55
|
+
query.set('limit', String(args.limit));
|
|
56
56
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
57
57
|
const options = {
|
|
58
58
|
headers: extra.headers,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -18,9 +18,9 @@ export const annotations = {
|
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
idempotentHint: true,
|
|
20
20
|
};
|
|
21
|
-
export async function handler(
|
|
21
|
+
export async function handler(args, extra) {
|
|
22
22
|
try {
|
|
23
|
-
const endpoint = `/collections/${
|
|
23
|
+
const endpoint = `/collections/${args.collectionId}/requests/${args.requestId}/comments`;
|
|
24
24
|
const query = new URLSearchParams();
|
|
25
25
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
26
26
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -16,9 +16,9 @@ export const annotations = {
|
|
|
16
16
|
destructiveHint: false,
|
|
17
17
|
idempotentHint: true,
|
|
18
18
|
};
|
|
19
|
-
export async function handler(
|
|
19
|
+
export async function handler(args, extra) {
|
|
20
20
|
try {
|
|
21
|
-
const endpoint = `/collections/${
|
|
21
|
+
const endpoint = `/collections/${args.collectionId}/responses/${args.responseId}/comments`;
|
|
22
22
|
const query = new URLSearchParams();
|
|
23
23
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
24
24
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/collections/${
|
|
18
|
+
const endpoint = `/collections/${args.collectionId}/source-status`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/specs/${
|
|
18
|
+
const endpoint = `/specs/${args.specId}`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -25,14 +25,14 @@ export const annotations = {
|
|
|
25
25
|
destructiveHint: false,
|
|
26
26
|
idempotentHint: true,
|
|
27
27
|
};
|
|
28
|
-
export async function handler(
|
|
28
|
+
export async function handler(args, extra) {
|
|
29
29
|
try {
|
|
30
|
-
const endpoint = `/specs/${
|
|
30
|
+
const endpoint = `/specs/${args.specId}/generations/${args.elementType}`;
|
|
31
31
|
const query = new URLSearchParams();
|
|
32
|
-
if (
|
|
33
|
-
query.set('limit', String(
|
|
34
|
-
if (
|
|
35
|
-
query.set('cursor', String(
|
|
32
|
+
if (args.limit !== undefined)
|
|
33
|
+
query.set('limit', String(args.limit));
|
|
34
|
+
if (args.cursor !== undefined)
|
|
35
|
+
query.set('cursor', String(args.cursor));
|
|
36
36
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
37
37
|
const options = {
|
|
38
38
|
headers: extra.headers,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/specs/${
|
|
18
|
+
const endpoint = `/specs/${args.specId}/definitions`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -16,9 +16,9 @@ export const annotations = {
|
|
|
16
16
|
destructiveHint: false,
|
|
17
17
|
idempotentHint: true,
|
|
18
18
|
};
|
|
19
|
-
export async function handler(
|
|
19
|
+
export async function handler(args, extra) {
|
|
20
20
|
try {
|
|
21
|
-
const endpoint = `/specs/${
|
|
21
|
+
const endpoint = `/specs/${args.specId}/files/${args.filePath}`;
|
|
22
22
|
const query = new URLSearchParams();
|
|
23
23
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
24
24
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/specs/${
|
|
18
|
+
const endpoint = `/specs/${args.specId}/files`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -19,9 +19,9 @@ export const annotations = {
|
|
|
19
19
|
destructiveHint: false,
|
|
20
20
|
idempotentHint: true,
|
|
21
21
|
};
|
|
22
|
-
export async function handler(
|
|
22
|
+
export async function handler(args, extra) {
|
|
23
23
|
try {
|
|
24
|
-
const endpoint = `/apis/${
|
|
24
|
+
const endpoint = `/apis/${args.apiId}/tasks/${args.taskId}`;
|
|
25
25
|
const query = new URLSearchParams();
|
|
26
26
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
27
27
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -38,18 +38,18 @@ export const annotations = {
|
|
|
38
38
|
destructiveHint: false,
|
|
39
39
|
idempotentHint: true,
|
|
40
40
|
};
|
|
41
|
-
export async function handler(
|
|
41
|
+
export async function handler(args, extra) {
|
|
42
42
|
try {
|
|
43
|
-
const endpoint = `/tags/${
|
|
43
|
+
const endpoint = `/tags/${args.slug}/entities`;
|
|
44
44
|
const query = new URLSearchParams();
|
|
45
|
-
if (
|
|
46
|
-
query.set('limit', String(
|
|
47
|
-
if (
|
|
48
|
-
query.set('direction', String(
|
|
49
|
-
if (
|
|
50
|
-
query.set('cursor', String(
|
|
51
|
-
if (
|
|
52
|
-
query.set('entityType', String(
|
|
45
|
+
if (args.limit !== undefined)
|
|
46
|
+
query.set('limit', String(args.limit));
|
|
47
|
+
if (args.direction !== undefined)
|
|
48
|
+
query.set('direction', String(args.direction));
|
|
49
|
+
if (args.cursor !== undefined)
|
|
50
|
+
query.set('cursor', String(args.cursor));
|
|
51
|
+
if (args.entityType !== undefined)
|
|
52
|
+
query.set('entityType', String(args.entityType));
|
|
53
53
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
54
54
|
const options = {
|
|
55
55
|
headers: extra.headers,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -19,12 +19,12 @@ export const annotations = {
|
|
|
19
19
|
destructiveHint: false,
|
|
20
20
|
idempotentHint: true,
|
|
21
21
|
};
|
|
22
|
-
export async function handler(
|
|
22
|
+
export async function handler(args, extra) {
|
|
23
23
|
try {
|
|
24
|
-
const endpoint = `/workspaces/${
|
|
24
|
+
const endpoint = `/workspaces/${args.workspaceId}`;
|
|
25
25
|
const query = new URLSearchParams();
|
|
26
|
-
if (
|
|
27
|
-
query.set('include', String(
|
|
26
|
+
if (args.include !== undefined)
|
|
27
|
+
query.set('include', String(args.include));
|
|
28
28
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
29
29
|
const options = {
|
|
30
30
|
headers: extra.headers,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/workspaces/${
|
|
18
|
+
const endpoint = `/workspaces/${args.workspaceId}/global-variables`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -13,9 +13,9 @@ export const annotations = {
|
|
|
13
13
|
destructiveHint: false,
|
|
14
14
|
idempotentHint: true,
|
|
15
15
|
};
|
|
16
|
-
export async function handler(
|
|
16
|
+
export async function handler(args, extra) {
|
|
17
17
|
try {
|
|
18
|
-
const endpoint = `/workspaces/${
|
|
18
|
+
const endpoint = `/workspaces/${args.workspaceId}/tags`;
|
|
19
19
|
const query = new URLSearchParams();
|
|
20
20
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
21
21
|
const options = {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
function asMcpError(error) {
|
|
4
4
|
const cause = error?.cause ?? String(error);
|
|
5
5
|
return new McpError(ErrorCode.InternalError, cause);
|
|
6
6
|
}
|
|
7
7
|
export const method = 'getWorkspaces';
|
|
8
|
-
export const description = "Gets all
|
|
8
|
+
export const description = "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";
|
|
9
9
|
export const parameters = z.object({
|
|
10
10
|
type: z
|
|
11
11
|
.enum(['personal', 'team', 'private', 'public', 'partner'])
|
|
12
|
-
.describe('The type of workspace to filter the response by.')
|
|
12
|
+
.describe('The type of workspace to filter the response by. One of: `personal`, `team`, `private`, `public`, `partner`.\n- For “my …” requests, this can be combined with `createdBy`. If type is not specified, it will search across all types for that user.\n')
|
|
13
13
|
.optional(),
|
|
14
14
|
createdBy: z
|
|
15
15
|
.number()
|
|
16
16
|
.int()
|
|
17
|
-
.describe(
|
|
17
|
+
.describe("Return only workspaces created by the specified Postman user ID.\n- For “my …” requests, set `createdBy` to the current user’s ID from GET `/me` (`me.user.id`).\n- If the user's ID is not known, first call GET `/me`, then retry with `createdBy`.\n")
|
|
18
18
|
.optional(),
|
|
19
19
|
include: z
|
|
20
20
|
.enum(['mocks:deactivated', 'scim'])
|
|
@@ -22,21 +22,21 @@ export const parameters = z.object({
|
|
|
22
22
|
.optional(),
|
|
23
23
|
});
|
|
24
24
|
export const annotations = {
|
|
25
|
-
title: "Gets all
|
|
25
|
+
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",
|
|
26
26
|
readOnlyHint: true,
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
29
29
|
};
|
|
30
|
-
export async function handler(
|
|
30
|
+
export async function handler(args, extra) {
|
|
31
31
|
try {
|
|
32
32
|
const endpoint = `/workspaces`;
|
|
33
33
|
const query = new URLSearchParams();
|
|
34
|
-
if (
|
|
35
|
-
query.set('type', String(
|
|
36
|
-
if (
|
|
37
|
-
query.set('createdBy', String(
|
|
38
|
-
if (
|
|
39
|
-
query.set('include', String(
|
|
34
|
+
if (args.type !== undefined)
|
|
35
|
+
query.set('type', String(args.type));
|
|
36
|
+
if (args.createdBy !== undefined)
|
|
37
|
+
query.set('createdBy', String(args.createdBy));
|
|
38
|
+
if (args.include !== undefined)
|
|
39
|
+
query.set('include', String(args.include));
|
|
40
40
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
41
41
|
const options = {
|
|
42
42
|
headers: extra.headers,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
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);
|
|
@@ -21,18 +21,18 @@ export const annotations = {
|
|
|
21
21
|
destructiveHint: false,
|
|
22
22
|
idempotentHint: false,
|
|
23
23
|
};
|
|
24
|
-
export async function handler(
|
|
24
|
+
export async function handler(args, extra) {
|
|
25
25
|
try {
|
|
26
26
|
const endpoint = `/collections/merge`;
|
|
27
27
|
const query = new URLSearchParams();
|
|
28
28
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
29
29
|
const bodyPayload = {};
|
|
30
|
-
if (
|
|
31
|
-
bodyPayload.destination =
|
|
32
|
-
if (
|
|
33
|
-
bodyPayload.source =
|
|
34
|
-
if (
|
|
35
|
-
bodyPayload.strategy =
|
|
30
|
+
if (args.destination !== undefined)
|
|
31
|
+
bodyPayload.destination = args.destination;
|
|
32
|
+
if (args.source !== undefined)
|
|
33
|
+
bodyPayload.source = args.source;
|
|
34
|
+
if (args.strategy !== undefined)
|
|
35
|
+
bodyPayload.strategy = args.strategy;
|
|
36
36
|
const options = {
|
|
37
37
|
body: JSON.stringify(bodyPayload),
|
|
38
38
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
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);
|
|
@@ -288,14 +288,14 @@ export const annotations = {
|
|
|
288
288
|
destructiveHint: false,
|
|
289
289
|
idempotentHint: true,
|
|
290
290
|
};
|
|
291
|
-
export async function handler(
|
|
291
|
+
export async function handler(args, extra) {
|
|
292
292
|
try {
|
|
293
|
-
const endpoint = `/collections/${
|
|
293
|
+
const endpoint = `/collections/${args.collectionId}`;
|
|
294
294
|
const query = new URLSearchParams();
|
|
295
295
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
296
296
|
const bodyPayload = {};
|
|
297
|
-
if (
|
|
298
|
-
bodyPayload.collection =
|
|
297
|
+
if (args.collection !== undefined)
|
|
298
|
+
bodyPayload.collection = args.collection;
|
|
299
299
|
const options = {
|
|
300
300
|
body: JSON.stringify(bodyPayload),
|
|
301
301
|
contentType: ContentType.Json,
|
|
@@ -1,24 +1,70 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ContentType } from '../clients/postman.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
4
|
function asMcpError(error) {
|
|
4
5
|
const cause = error?.cause ?? String(error);
|
|
5
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
6
7
|
}
|
|
7
8
|
export const method = 'patchEnvironment';
|
|
8
9
|
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';
|
|
9
|
-
export const parameters = z.object({
|
|
10
|
+
export const parameters = z.object({
|
|
11
|
+
environmentId: z.string().describe("The environment's ID."),
|
|
12
|
+
body: z.union([
|
|
13
|
+
z.array(z.object({
|
|
14
|
+
op: z.string().describe('The `add` operation.'),
|
|
15
|
+
path: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('The [JSON Pointer syntax](https://datatracker.ietf.org/doc/html/rfc6901) that indicates the entry to update, in `/values/#` format, where `#` is the entry ID. The first record begins at the `0` value.'),
|
|
18
|
+
value: z
|
|
19
|
+
.object({
|
|
20
|
+
enabled: z.boolean().describe('If true, the variable is enabled.').optional(),
|
|
21
|
+
key: z.string().describe("The variable's name.").optional(),
|
|
22
|
+
value: z.string().describe("The variable's value.").optional(),
|
|
23
|
+
type: z
|
|
24
|
+
.enum(['secret', 'default'])
|
|
25
|
+
.describe("The variable's type:\n- `secret` — The variable value is masked.\n- `default` — The variable value is visible in plain text.\n")
|
|
26
|
+
.optional(),
|
|
27
|
+
description: z.string().max(512).describe("The variable's description.").optional(),
|
|
28
|
+
})
|
|
29
|
+
.describe("Information about the environment's variables."),
|
|
30
|
+
})),
|
|
31
|
+
z.array(z
|
|
32
|
+
.object({
|
|
33
|
+
op: z.string().describe('The `replace` operation.'),
|
|
34
|
+
path: z.string().describe('The `/name` value.'),
|
|
35
|
+
value: z.string().describe("The environment's updated name."),
|
|
36
|
+
})
|
|
37
|
+
.describe('Information about the environment.')),
|
|
38
|
+
z.array(z.object({
|
|
39
|
+
op: z.string().describe('The `replace` operation.'),
|
|
40
|
+
path: z
|
|
41
|
+
.string()
|
|
42
|
+
.describe('The [JSON Pointer syntax](https://datatracker.ietf.org/doc/html/rfc6901) that indicates the entry to update, in `/values/#/{value}` format, where:\n- `#` — The entry ID. The first record begins at the `0` value.\n- `{value}` — The variable property to update. Accepts `key`, `value`, `type`, and `enable`.\n'),
|
|
43
|
+
value: z.string().describe("The variable's value."),
|
|
44
|
+
})),
|
|
45
|
+
z.array(z.object({
|
|
46
|
+
op: z.string().describe('The `remove` operation.'),
|
|
47
|
+
path: z
|
|
48
|
+
.string()
|
|
49
|
+
.describe('The [JSON Pointer syntax](https://datatracker.ietf.org/doc/html/rfc6901) that indicates the entry to update, in `/values/#` format, where `#` is the entry ID. The first record begins at the `0` value.'),
|
|
50
|
+
})),
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
10
53
|
export const annotations = {
|
|
11
54
|
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',
|
|
12
55
|
readOnlyHint: false,
|
|
13
56
|
destructiveHint: false,
|
|
14
57
|
idempotentHint: true,
|
|
15
58
|
};
|
|
16
|
-
export async function handler(
|
|
59
|
+
export async function handler(args, extra) {
|
|
17
60
|
try {
|
|
18
|
-
const endpoint = `/environments/${
|
|
61
|
+
const endpoint = `/environments/${args.environmentId}`;
|
|
19
62
|
const query = new URLSearchParams();
|
|
20
63
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
64
|
+
const bodyPayload = args.body;
|
|
21
65
|
const options = {
|
|
66
|
+
body: JSON.stringify(bodyPayload),
|
|
67
|
+
contentType: ContentType.Json,
|
|
22
68
|
headers: extra.headers,
|
|
23
69
|
};
|
|
24
70
|
const result = await extra.client.patch(url, options);
|