Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ const logger = {

let currentApiKey: string | undefined = undefined;

const allGeneratedTools = await loadAllTools();
logger.info(`Dynamically loaded ${allGeneratedTools.length} tools...`);

async function run() {
const args = process.argv.slice(2);
const isSSE = args.includes('--sse') || process.env.MCP_TRANSPORT === 'sse';
logger.info(`Transport mode determined: ${isSSE ? 'HTTP/SSE' : 'Stdio'}`);

const allGeneratedTools = await loadAllTools();
logger.info(`Dynamically loaded ${allGeneratedTools.length} tools...`);

const server = new Server(
{ name: SERVER_NAME, version: APP_VERSION },
{ capabilities: { tools: {} } }
Expand All @@ -127,6 +127,8 @@ async function run() {
process.exit(0);
});

logger.info(`Registering ${allGeneratedTools.length} tools...`);

server.setRequestHandler(CallToolRequestSchema, async (request) => {
const toolName = request.params.name;
const tool = allGeneratedTools.find((t) => t.method === toolName);
Expand Down
4,675 changes: 309 additions & 4,366 deletions src/tools/create_collection.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/tools/create_collection_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const parameters = z.object({
userName: z
.object({
type: z.literal('user').describe('The `user` value.'),
id: z.number().int().describe("The user's ID."),
id: z.string().describe("The user's ID."),
})
.describe(
"An object that contains information about the tagged user. The object's name is the user's Postman username. For example, `@user-postman`."
Expand Down
9 changes: 1 addition & 8 deletions src/tools/create_collection_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const method = 'create-collection-request';
export const description =
'Creates a request in a collection. For a complete list of properties, refer to the **Request** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).\n\n**Note:**\n\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 request with a blank name.\n';
export const parameters = z.object({
collectionId: z.string(),
collectionId: z.string().describe("The collection's ID."),
folderId: z
.string()
.describe(
Expand All @@ -18,9 +18,6 @@ export const parameters = z.object({
"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."
)
.optional(),
url: z.string().describe('The URL for the request.').optional(),
method: z.string().describe('The HTTP method for the request (e.g., POST, GET).').optional(),
body: z.record(z.any()).describe("The request's body.").optional(),
});
export const annotations = {
title:
Expand All @@ -41,10 +38,6 @@ export async function handler(
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
const bodyPayload: any = {};
if (params.name !== undefined) bodyPayload.name = params.name;
if (params.url !== undefined) bodyPayload.url = params.url;
if (params.method !== undefined) bodyPayload.method = params.method;
if (params.body !== undefined) bodyPayload.body = params.body;
if (params.collectionId !== undefined) bodyPayload.collectionId = params.collectionId;
const result = await fetchPostmanAPI(url, {
method: 'POST',
body: JSON.stringify(bodyPayload),
Expand Down
2 changes: 1 addition & 1 deletion src/tools/create_environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const parameters = z.object({
enabled: z.boolean().describe('If true, the variable is enabled.').optional(),
key: z.string().describe("The variable's name.").optional(),
value: z.string().describe("The variable's value.").optional(),
type: z.enum(['secret', 'default', 'any']).describe('The variable type.').optional(),
type: z.enum(['secret', 'default']).describe('The variable type.').optional(),
})
)
.describe("Information about the environment's variables.")
Expand Down
2 changes: 1 addition & 1 deletion src/tools/create_folder_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const parameters = z.object({
userName: z
.object({
type: z.literal('user').describe('The `user` value.'),
id: z.number().int().describe("The user's ID."),
id: z.string().describe("The user's ID."),
})
.describe(
"An object that contains information about the tagged user. The object's name is the user's Postman username. For example, `@user-postman`."
Expand Down
2 changes: 1 addition & 1 deletion src/tools/create_request_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const parameters = z.object({
userName: z
.object({
type: z.literal('user').describe('The `user` value.'),
id: z.number().int().describe("The user's ID."),
id: z.string().describe("The user's ID."),
})
.describe(
"An object that contains information about the tagged user. The object's name is the user's Postman username. For example, `@user-postman`."
Expand Down
2 changes: 1 addition & 1 deletion src/tools/create_response_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const parameters = z.object({
userName: z
.object({
type: z.literal('user').describe('The `user` value.'),
id: z.number().int().describe("The user's ID."),
id: z.string().describe("The user's ID."),
})
.describe(
"An object that contains information about the tagged user. The object's name is the user's Postman username. For example, `@user-postman`."
Expand Down
6 changes: 4 additions & 2 deletions src/tools/get_monitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export const parameters = z.object({
limit: z
.number()
.int()
.describe('The maximum number of rows to return in the response.')
.default(10),
.describe(
'The maximum number of rows to return in the response, up to a maximum value of 25. Any value greater than 25 returns a 400 Bad Request response.'
)
.default(25),
});
export const annotations = {
title: 'Gets all monitors.',
Expand Down
Loading