Skip to main content
Glama

syncCollectionWithSpec

Synchronize a Postman collection with its OpenAPI specification. Async endpoint returns 202 for OpenAPI 2.0, 3.0, and 3.1.

Instructions

Syncs a collection generated from an API spec. Async endpoint returns 202. Only for OpenAPI 2.0/3.0/3.1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specIdYesSpec ID
collectionUidYesCollection unique ID

Implementation Reference

  • The SyncCollectionWithSpecTool class handles the 'syncCollectionWithSpec' tool. It sends a PUT request to /apis/{specId}/collections/{collectionUid}/sync to sync a collection generated from an API spec. Requires specId and collectionUid as input parameters.
    class SyncCollectionWithSpecTool(ToolHandler):
        """Sync collection with spec"""
        
        def __init__(self):
            super().__init__("syncCollectionWithSpec")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Syncs a collection generated from an API spec. Async endpoint returns 202. Only for OpenAPI 2.0/3.0/3.1.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "specId": {
                            "type": "string",
                            "description": "Spec ID"
                        },
                        "collectionUid": {
                            "type": "string",
                            "description": "Collection unique ID"
                        }
                    },
                    "required": ["specId", "collectionUid"]
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            spec_id = args["specId"]
            collection_uid = args["collectionUid"]
            
            result = await postman_api_call("PUT", f"/apis/{spec_id}/collections/{collection_uid}/sync")
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • The tool is registered in the register_all_tools() function at line 1880, which returns a list of all ToolHandler instances.
    SyncCollectionWithSpecTool(),
  • The input schema (inside get_tool_description) defines two required string properties: specId and collectionUid.
    def get_tool_description(self) -> Tool:
        return Tool(
            name=self.name,
            description="Syncs a collection generated from an API spec. Async endpoint returns 202. Only for OpenAPI 2.0/3.0/3.1.",
            inputSchema={
                "type": "object",
                "properties": {
                    "specId": {
                        "type": "string",
                        "description": "Spec ID"
                    },
                    "collectionUid": {
                        "type": "string",
                        "description": "Collection unique ID"
                    }
                },
                "required": ["specId", "collectionUid"]
            },
        )
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the async nature (returns 202) but does not mention whether the operation is destructive, required permissions, or error conditions.

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 sentences, no fluff, front-loaded with key information. Every sentence adds value.

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

Completeness4/5

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

Given no output schema, two required params, and the description covers the async behavior and version constraints. However, it could mention what the response body contains beyond status 202.

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 has 100% coverage with basic descriptions ('Spec ID', 'Collection unique ID'). The description adds no additional meaning to the parameters.

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 action ('Syncs a collection generated from an API spec'), specifies the async nature and return status, and limits to specific API spec formats. This distinguishes it from siblings like syncSpecWithCollection.

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?

It specifies the tool is only for OpenAPI 2.0/3.0/3.1, providing clear when-to-use guidance. It does not explicitly state when not to use or mention alternatives, but the constraint is strong.

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