createCollectionResponse
Document expected API responses by creating a response entry in a Postman collection request with status, headers, and body.
Instructions
Creates a request response in a collection. Recommended to pass 'name' property. See Response entry in Postman Collection Format docs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes | Collection ID | |
| request | Yes | Parent request ID | |
| name | No | Response name | |
| description | No | Response description | |
| status | No | HTTP status text | |
| responseCode | No | HTTP response code info | |
| headers | No | Response headers | |
| cookies | No | Cookie data | |
| text | No | Raw response body text | |
| language | No | Language type | |
| mime | No | MIME type | |
| time | No | Time taken (ms) | |
| method | No | Request HTTP method | |
| url | No | Request URL | |
| dataMode | No | Request body data mode | |
| dataOptions | No | Data mode options | |
| rawModeData | No | Raw mode data | |
| rawDataType | No | Raw data type | |
| requestObject | No | JSON-stringified request representation |
Implementation Reference
- tools/postman_tools.py:512-611 (handler)Handler class CreateCollectionResponseTool: registers tool name 'createCollectionResponse', defines input schema (required: collectionId, request), and executes POST /collections/{collectionId}/responses API call.
class CreateCollectionResponseTool(ToolHandler): """Create a response in a collection""" def __init__(self): super().__init__("createCollectionResponse") def get_tool_description(self) -> Tool: return Tool( name=self.name, description="Creates a request response in a collection. Recommended to pass 'name' property. See Response entry in Postman Collection Format docs.", inputSchema={ "type": "object", "properties": { "collectionId": { "type": "string", "description": "Collection ID" }, "request": { "type": "string", "description": "Parent request ID" }, "name": { "type": "string", "description": "Response name" }, "description": { "type": "string", "description": "Response description" }, "status": { "type": "string", "description": "HTTP status text" }, "responseCode": { "type": "object", "description": "HTTP response code info" }, "headers": { "type": "array", "description": "Response headers" }, "cookies": { "type": "string", "description": "Cookie data" }, "text": { "type": "string", "description": "Raw response body text" }, "language": { "type": "string", "description": "Language type" }, "mime": { "type": "string", "description": "MIME type" }, "time": { "type": "string", "description": "Time taken (ms)" }, "method": { "type": "string", "description": "Request HTTP method" }, "url": { "type": "string", "description": "Request URL" }, "dataMode": { "type": "string", "description": "Request body data mode" }, "dataOptions": { "type": "string", "description": "Data mode options" }, "rawModeData": { "type": "string", "description": "Raw mode data" }, "rawDataType": { "type": "string", "description": "Raw data type" }, "requestObject": { "type": "string", "description": "JSON-stringified request representation" } }, "required": ["collectionId", "request"] }, ) async def run_tool(self, args: dict) -> list[TextContent]: collection_id = args.pop("collectionId") body = {k: v for k, v in args.items() if v is not None} result = await postman_api_call("POST", f"/collections/{collection_id}/responses", body=body) return [TextContent(type="text", text=json.dumps(result, indent=2))] - tools/postman_tools.py:522-604 (schema)Input schema for createCollectionResponse: requires collectionId and request, with optional fields for response details (status, responseCode, headers, cookies, body, etc.).
inputSchema={ "type": "object", "properties": { "collectionId": { "type": "string", "description": "Collection ID" }, "request": { "type": "string", "description": "Parent request ID" }, "name": { "type": "string", "description": "Response name" }, "description": { "type": "string", "description": "Response description" }, "status": { "type": "string", "description": "HTTP status text" }, "responseCode": { "type": "object", "description": "HTTP response code info" }, "headers": { "type": "array", "description": "Response headers" }, "cookies": { "type": "string", "description": "Cookie data" }, "text": { "type": "string", "description": "Raw response body text" }, "language": { "type": "string", "description": "Language type" }, "mime": { "type": "string", "description": "MIME type" }, "time": { "type": "string", "description": "Time taken (ms)" }, "method": { "type": "string", "description": "Request HTTP method" }, "url": { "type": "string", "description": "Request URL" }, "dataMode": { "type": "string", "description": "Request body data mode" }, "dataOptions": { "type": "string", "description": "Data mode options" }, "rawModeData": { "type": "string", "description": "Raw mode data" }, "rawDataType": { "type": "string", "description": "Raw data type" }, "requestObject": { "type": "string", "description": "JSON-stringified request representation" } }, "required": ["collectionId", "request"] }, ) - tools/postman_tools.py:1849-1849 (registration)Tool is registered in register_all_tools() at line 1849, making it available as one of the 41 MCP tools.
CreateCollectionResponseTool(),