getMock
Retrieve details of a Postman mock server, including its collection UID and mock URL, by providing the mock server ID.
Instructions
Gets information about a mock server, including associated collection UID and mockUrl.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mockId | Yes | Mock server ID |
Implementation Reference
- tools/postman_tools.py:784-809 (handler)The GetMockTool class implements the 'getMock' tool. It handles mock server information retrieval via GET /mocks/{mock_id} API call, requiring 'mockId' as input.
class GetMockTool(ToolHandler): """Get mock server information""" def __init__(self): super().__init__("getMock") def get_tool_description(self) -> Tool: return Tool( name=self.name, description="Gets information about a mock server, including associated collection UID and mockUrl.", inputSchema={ "type": "object", "properties": { "mockId": { "type": "string", "description": "Mock server ID" } }, "required": ["mockId"] }, ) async def run_tool(self, args: dict) -> list[TextContent]: mock_id = args["mockId"] result = await postman_api_call("GET", f"/mocks/{mock_id}") return [TextContent(type="text", text=json.dumps(result, indent=2))] - tools/postman_tools.py:791-804 (schema)Input schema for getMock tool - requires a single 'mockId' string parameter.
return Tool( name=self.name, description="Gets information about a mock server, including associated collection UID and mockUrl.", inputSchema={ "type": "object", "properties": { "mockId": { "type": "string", "description": "Mock server ID" } }, "required": ["mockId"] }, ) - tools/postman_tools.py:1857-1860 (registration)Registration of GetMockTool() in the register_all_tools() function at line 1859.
# Mocks CreateMockTool(), GetMockTool(), GetMocksTool(), - tools/toolhandler.py:9-24 (helper)Abstract base class ToolHandler that GetMockTool extends, providing common initialization with name attribute.
class ToolHandler(ABC): """Base class for all Postman tool handlers""" def __init__(self, name: str): self.name = name @abstractmethod def get_tool_description(self) -> Tool: """Return the MCP Tool description for this handler""" pass @abstractmethod async def run_tool(self, arguments: dict) -> list[TextContent | ImageContent | EmbeddedResource]: """Execute the tool with the given arguments""" pass