Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
mockIdYesMock server ID

Implementation Reference

  • 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))]
  • 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"]
        },
    )
  • Registration of GetMockTool() in the register_all_tools() function at line 1859.
    # Mocks
    CreateMockTool(),
    GetMockTool(),
    GetMocksTool(),
  • 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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description does not disclose behavioral traits beyond stating it 'gets information'. With no annotations, it fails to mention that this is a read-only operation, any required permissions, or potential side effects. It only hints at the response content without full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence of 12 words, directly stating the tool's purpose. It is concise and front-loaded, with no unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple tool with one parameter and no output schema, the description is adequate but not fully complete. It mentions two specific pieces of information returned (collection UID and mockUrl) but does not confirm the full response structure or potential errors. It meets the minimum viable standard.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes the 'mockId' parameter as 'Mock server ID'. The description adds no additional meaning or context about the parameter, such as its format or where to find it. Since schema coverage is 100%, the description does not need to compensate, but it also does not enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves information about a mock server, specifically mentioning the collection UID and mockUrl. This distinguishes it from sibling tools like 'getMocks' (which likely lists mocks) and 'createMock' (which creates a mock).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'getMocks' for listing or 'publishMock' for publishing. There is no mention of context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sourav4670/postman-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server