Skip to main content
Glama

createWorkspace

Creates a new Postman workspace with specified name, type, and description. Supports private, partner, and public types; private/partner require team or enterprise plan. Optionally include team ID for organizations.

Instructions

Creates a new workspace. Private/Partner workspaces require Team/Enterprise. Public names must be unique. Pass teamId if Organizations is enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNoWorkspace object with name, type, description

Implementation Reference

  • Handler class for createWorkspace tool. Sends POST request to /workspaces with workspace object payload containing name, type, description.
    class CreateWorkspaceTool(ToolHandler):
        """Create workspace"""
        
        def __init__(self):
            super().__init__("createWorkspace")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Creates a new workspace. Private/Partner workspaces require Team/Enterprise. Public names must be unique. Pass teamId if Organizations is enabled.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "workspace": {
                            "type": "object",
                            "description": "Workspace object with name, type, description"
                        }
                    },
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            body = {"workspace": args.get("workspace", {})}
            result = await postman_api_call("POST", "/workspaces", body=body)
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Input schema for createWorkspace tool. Accepts an optional workspace object with name, type, and description properties.
    def get_tool_description(self) -> Tool:
        return Tool(
            name=self.name,
            description="Creates a new workspace. Private/Partner workspaces require Team/Enterprise. Public names must be unique. Pass teamId if Organizations is enabled.",
            inputSchema={
                "type": "object",
                "properties": {
                    "workspace": {
                        "type": "object",
                        "description": "Workspace object with name, type, description"
                    }
                },
            },
  • Registration of CreateWorkspaceTool in the register_all_tools() function's returned list.
    CreateWorkspaceTool(),
  • Helper function postman_api_call used by createWorkspace (and all other tools) to make HTTP requests to the Postman API.
    async def postman_api_call(
        method: str,
        endpoint: str,
        body: dict | None = None,
        params: dict | None = None,
        headers: dict | None = None
    ) -> dict:
        """Make an API call to Postman API"""
        if not POSTMAN_API_KEY:
            raise RuntimeError("POSTMAN_API_KEY environment variable is not set")
        
        url = f"{POSTMAN_BASE_URL}{endpoint}"
        
        # Prepare headers
        request_headers = {
            "X-Api-Key": POSTMAN_API_KEY,
            "Content-Type": "application/json",
        }
        if headers:
            request_headers.update(headers)
        
        async with httpx.AsyncClient(timeout=30.0) as client:
            try:
                response = await client.request(
                    method=method,
                    url=url,
                    json=body,
                    params=params,
                    headers=request_headers
                )
                response.raise_for_status()
                
                if response.status_code == 204:
                    return {"success": True, "message": "Operation completed successfully"}
                
                return response.json() if response.content else {"success": True}
            
            except httpx.HTTPStatusError as e:
                error_detail = e.response.text
                try:
                    error_json = e.response.json()
                    error_detail = json.dumps(error_json, indent=2)
                except:
                    pass
                raise RuntimeError(f"Postman API error ({e.response.status_code}): {error_detail}")
            except Exception as e:
                raise RuntimeError(f"Request failed: {str(e)}")
Behavior3/5

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

The description mentions the creation behavior and important constraints, but lacks details on what the tool returns (e.g., workspace ID) and error handling. Since no annotations are provided, the description carries the burden, but it is partially adequate.

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 two sentences long, front-loaded with the main purpose, and every sentence adds value without any unnecessary words.

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?

The description covers creation purpose and key constraints, but lacks information about required fields (is name required?), success output, and error scenarios. Given the nested object parameter and no output schema, it is adequate but not complete.

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 schema covers the workspace parameter with a description. The tool's description adds context about type constraints and the optional teamId field, but the teamId is not in the schema, causing slight inconsistency. Overall, it adds some meaning beyond the schema.

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 'Creates a new workspace', using a specific verb and resource. It distinguishes itself from sibling tools like updateWorkspace and getWorkspaces, as it is the only creation tool for workspaces.

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?

The description provides clear context for when to use the tool by specifying constraints: Private/Partner workspaces require Team/Enterprise, public names must be unique, and teamId should be passed if Organizations is enabled. It does not explicitly state when not to use it, but that is implied by the existence of updateWorkspace.

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