Skip to main content
Glama

getMocks

Retrieve all active mock servers by providing a workspace ID or team ID. Use workspace ID for preferred results.

Instructions

Gets all active mock servers. Always pass workspace or teamId. Prefer workspace when known. Set teamId from GET /me (me.teamId) for team scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamIdNoTeam ID (from GET /me: me.teamId)
workspaceNoWorkspace ID (preferred)

Implementation Reference

  • GetMocksTool class: the handler for the 'getMocks' tool. Registers with name 'getMocks'. Accepts optional 'teamId' and 'workspace' parameters. Calls GET /mocks on the Postman API with the provided params.
    class GetMocksTool(ToolHandler):
        """Get all mock servers"""
        
        def __init__(self):
            super().__init__("getMocks")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Gets all active mock servers. Always pass workspace or teamId. Prefer workspace when known. Set teamId from GET /me (me.teamId) for team scope.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "teamId": {
                            "type": "string",
                            "description": "Team ID (from GET /me: me.teamId)"
                        },
                        "workspace": {
                            "type": "string",
                            "description": "Workspace ID (preferred)"
                        }
                    },
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            params = {}
            if args.get("workspace"):
                params["workspace"] = args["workspace"]
            elif args.get("teamId"):
                params["teamId"] = args["teamId"]
            
            result = await postman_api_call("GET", "/mocks", params=params)
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Input schema for 'getMocks' tool: accepts optional 'teamId' (string) and 'workspace' (string) properties with descriptions about scope preference.
    class GetMocksTool(ToolHandler):
        """Get all mock servers"""
        
        def __init__(self):
            super().__init__("getMocks")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Gets all active mock servers. Always pass workspace or teamId. Prefer workspace when known. Set teamId from GET /me (me.teamId) for team scope.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "teamId": {
                            "type": "string",
                            "description": "Team ID (from GET /me: me.teamId)"
                        },
                        "workspace": {
                            "type": "string",
                            "description": "Workspace ID (preferred)"
                        }
                    },
                },
            )
  • Registration of GetMocksTool() in the register_all_tools() function, which returns the list of all tool handler instances.
    # Mocks
    CreateMockTool(),
    GetMockTool(),
    GetMocksTool(),
    UpdateMockTool(),
    PublishMockTool(),
  • ToolHandler base class (ABC) that GetMocksTool extends. Defines the interface with get_tool_description() and run_tool() abstract methods.
    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
  • Test verification that 'getMocks' is among the expected tool names in the test suite.
    "getMocks",
Behavior2/5

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

No annotations provided, so description carries full burden. It only states it gets all active mock servers, but does not disclose whether there are side effects, rate limits, pagination, or the exact set of fields returned. Lacks behavioral depth.

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?

Three sentences, front-loaded with purpose. No extraneous information. Efficient and well-structured.

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

Completeness2/5

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

No output schema exists, yet the description does not describe the response structure or any other contextual details (e.g., pagination, sorting). Combined with absent annotations, the tool is under-documented for practical use.

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

Parameters4/5

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

Schema description coverage is 100%, baseline 3. The description adds value by instructing on parameter preference (workspace over teamId) and how to derive teamId, beyond the schema's brief descriptions.

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

Purpose5/5

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

The description clearly states the tool gets all active mock servers. It uses specific verb (Gets) and resource (active mock servers), and is distinguishable from siblings like getMock (single), createMock, etc.

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

Usage Guidelines4/5

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

Provides clear guidance on when to pass workspace vs teamId, preferring workspace when known and instructing how to obtain teamId from GET /me. Does not explicitly state when not to use this tool or list alternatives, but the context is sufficient.

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