Skip to main content
Glama

updateWorkspace

Update workspace name or visibility, with restrictions: some visibility changes are not allowed, and public names must be unique.

Instructions

Updates a workspace property (name, visibility, etc.). Some visibility changes not allowed. Public names must be unique.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
workspaceNoWorkspace updates

Implementation Reference

  • The UpdateWorkspaceTool class is the handler for the 'updateWorkspace' tool. It extends ToolHandler, defines the tool schema (requiring workspaceId and optional workspace object), and executes a PUT request to /workspaces/{workspace_id} on the Postman API.
    class UpdateWorkspaceTool(ToolHandler):
        """Update workspace"""
        
        def __init__(self):
            super().__init__("updateWorkspace")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Updates a workspace property (name, visibility, etc.). Some visibility changes not allowed. Public names must be unique.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "workspaceId": {
                            "type": "string",
                            "description": "Workspace ID"
                        },
                        "workspace": {
                            "type": "object",
                            "description": "Workspace updates"
                        }
                    },
                    "required": ["workspaceId"]
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            workspace_id = args["workspaceId"]
            body = {"workspace": args.get("workspace", {})}
            
            result = await postman_api_call("PUT", f"/workspaces/{workspace_id}", body=body)
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Input schema for updateWorkspace: requires workspaceId (string) and accepts workspace (object) for updates.
        inputSchema={
            "type": "object",
            "properties": {
                "workspaceId": {
                    "type": "string",
                    "description": "Workspace ID"
                },
                "workspace": {
                    "type": "object",
                    "description": "Workspace updates"
                }
            },
            "required": ["workspaceId"]
        },
    )
  • UpdateWorkspaceTool() is registered in the register_all_tools() function at line 1887, which returns a list of all ToolHandler instances for MCP.
    UpdateWorkspaceTool(),
  • The postman_api_call helper function is used by the handler 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?

With no annotations, description adds some behavioral context (disallowed visibility changes, uniqueness requirement) but lacks detail on side effects, auth needs, or error handling.

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?

Two concise sentences, front-loaded with purpose and constraints, no redundant 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 no output schema and nested objects, description covers basic usage but omits explanations of return values, error cases, or comprehensive update behavior.

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?

Schema coverage is 100% with descriptions for both parameters. Description adds slight context about updatable fields (name, visibility) but doesn't significantly augment schema meaning.

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?

Description clearly states the action ('Updates') and the target resource ('workspace property'), with specific examples (name, visibility) that distinguish it from sibling tools like createWorkspace or getWorkspace.

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 constraints on visibility changes and public name uniqueness, implying when not to use, but does not explicitly compare with alternative tools or specify prerequisites.

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