add_postman_collection_event
Adds an event script (pre-request or test) to a Postman collection file, enabling custom automation for API testing.
Instructions
Add an event to the Postman collection
Args:
file_path: The path to the Postman collection file (string)
event: The event dictionary with keys like listen, script, etc. (dict)
Example: {
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": ["console.log('This runs before each request');"]
}
}
Returns:
The updated Postman collection data (dict)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"event": "<event>"
},
"name": "add_postman_collection_event"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| event | Yes |