Skip to main content
Glama

getCollections

Retrieve all Postman collections within a specified workspace. Provide the workspace ID to get the list.

Instructions

Gets all collections in a workspace. Workspace ID is required - ask user if not provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace's ID (required)
limitNoMaximum number of rows to return
nameNoFilter by collections matching this name
offsetNoZero-based offset for pagination

Implementation Reference

  • The async run_tool method that executes the getCollections logic. Makes a GET /collections call to the Postman API with workspace (required), limit, name, and offset query parameters.
    async def run_tool(self, args: dict) -> list[TextContent]:
        params = {"workspace": args["workspace"]}
        if args.get("limit"):
            params["limit"] = args["limit"]
        if args.get("name"):
            params["name"] = args["name"]
        if args.get("offset"):
            params["offset"] = args["offset"]
        
        result = await postman_api_call("GET", "/collections", params=params)
        return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • The get_tool_description method defining the input schema for getCollections. Requires workspace (string), with optional limit (integer), name (string), and offset (integer) parameters.
    def get_tool_description(self) -> Tool:
        return Tool(
            name=self.name,
            description="Gets all collections in a workspace. Workspace ID is required - ask user if not provided.",
            inputSchema={
                "type": "object",
                "properties": {
                    "workspace": {
                        "type": "string",
                        "description": "The workspace's ID (required)"
                    },
                    "limit": {
                        "type": "integer",
                        "description": "Maximum number of rows to return"
                    },
                    "name": {
                        "type": "string",
                        "description": "Filter by collections matching this name"
                    },
                    "offset": {
                        "type": "integer",
                        "description": "Zero-based offset for pagination"
                    }
                },
                "required": ["workspace"]
            },
        )
  • Registration of GetCollectionsTool() in the register_all_tools() function, which returns it as part of the list of all tool handlers.
    GetCollectionsTool(),
  • The GetCollectionsTool class definition and __init__ method, which extends ToolHandler and registers with the name 'getCollections'.
    class GetCollectionsTool(ToolHandler):
        """Get all collections in a workspace"""
        
        def __init__(self):
            super().__init__("getCollections")
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It implies a read-only operation but does not explicitly confirm safety, side effects, or behavior like pagination or filtering details. This is a significant gap for a tool with no annotations.

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, with the purpose front-loaded in the first sentence and usage guidance in the second. Every word earns its place, and there is no redundancy or fluff.

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?

For a listing tool with 4 parameters and no output schema, the description covers the core purpose and a key usage point. However, it omits details about pagination, filtering behavior beyond 'name', or return format, leaving some gaps for an agent to infer.

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%, so the baseline is 3. The description does not add new meaning beyond the schema; it only repeats the requirement for workspace ID, which is already in the required field. No additional semantic value for 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 'Gets all collections in a workspace,' which specifies the verb (gets), resource (collections), and scope (in a workspace). This distinguishes it from sibling tools like getCollection (singular) and createCollection.

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 explicitly states that the workspace ID is required and advises to 'ask user if not provided,' providing clear guidance on the prerequisite. However, it does not mention when to avoid using this tool or suggest alternatives.

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