getCollection
Retrieve information about a Postman collection. Choose between lightweight, minimal, or full response models.
Instructions
Get information about a collection. Returns lightweight collection map by default. Use model='minimal' for root-level IDs only, or model='full' for complete payload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes | The collection ID in format <OWNER_ID>-<COLLECTION_ID> | |
| access_key | No | Collection's read-only access key (optional, doesn't require API key) | |
| model | No | Response model: 'minimal' for root-level IDs, 'full' for complete payload |
Implementation Reference
- tools/postman_tools.py:135-175 (handler)The GetCollectionTool class - the handler that executes the 'getCollection' tool logic. The run_tool method sends a GET request to /collections/{collection_id} with optional access_key and model parameters.
class GetCollectionTool(ToolHandler): """Get collection information""" def __init__(self): super().__init__("getCollection") def get_tool_description(self) -> Tool: return Tool( name=self.name, description="Get information about a collection. Returns lightweight collection map by default. Use model='minimal' for root-level IDs only, or model='full' for complete payload.", inputSchema={ "type": "object", "properties": { "collectionId": { "type": "string", "description": "The collection ID in format <OWNER_ID>-<COLLECTION_ID>" }, "access_key": { "type": "string", "description": "Collection's read-only access key (optional, doesn't require API key)" }, "model": { "type": "string", "enum": ["minimal", "full"], "description": "Response model: 'minimal' for root-level IDs, 'full' for complete payload" } }, "required": ["collectionId"] }, ) async def run_tool(self, args: dict) -> list[TextContent]: collection_id = args["collectionId"] params = {} if args.get("access_key"): params["access_key"] = args["access_key"] if args.get("model"): params["model"] = args["model"] result = await postman_api_call("GET", f"/collections/{collection_id}", params=params) return [TextContent(type="text", text=json.dumps(result, indent=2))] - tools/postman_tools.py:141-163 (schema)The input schema for the 'getCollection' tool. Defines required 'collectionId' parameter and optional 'access_key' and 'model' (enum: minimal/full) parameters.
def get_tool_description(self) -> Tool: return Tool( name=self.name, description="Get information about a collection. Returns lightweight collection map by default. Use model='minimal' for root-level IDs only, or model='full' for complete payload.", inputSchema={ "type": "object", "properties": { "collectionId": { "type": "string", "description": "The collection ID in format <OWNER_ID>-<COLLECTION_ID>" }, "access_key": { "type": "string", "description": "Collection's read-only access key (optional, doesn't require API key)" }, "model": { "type": "string", "enum": ["minimal", "full"], "description": "Response model: 'minimal' for root-level IDs, 'full' for complete payload" } }, "required": ["collectionId"] }, - tools/postman_tools.py:1840-1840 (registration)Registration of GetCollectionTool() in the register_all_tools() function, which creates an instance to be used by the MCP framework.
GetCollectionTool(),