Skip to main content
Glama

getSpec

Retrieves details of an API specification using its spec ID. Provides information about the specification stored in Postman.

Instructions

Gets information about an API specification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specIdYesSpec ID

Implementation Reference

  • The GetSpecTool class implements the 'getSpec' tool. It extends ToolHandler, initializes with name 'getSpec', defines the input schema (requiring a 'specId' string), and the run_tool method which calls the Postman API GET /apis/{spec_id} to retrieve API specification information.
    class GetSpecTool(ToolHandler):
        """Get API specification"""
        
        def __init__(self):
            super().__init__("getSpec")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Gets information about an API specification.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "specId": {
                            "type": "string",
                            "description": "Spec ID"
                        }
                    },
                    "required": ["specId"]
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            spec_id = args["specId"]
            result = await postman_api_call("GET", f"/apis/{spec_id}")
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Input schema for 'getSpec' tool defines a required 'specId' string property. The tool gets information about an API specification.
    def get_tool_description(self) -> Tool:
        return Tool(
            name=self.name,
            description="Gets information about an API specification.",
            inputSchema={
                "type": "object",
                "properties": {
                    "specId": {
                        "type": "string",
                        "description": "Spec ID"
                    }
                },
                "required": ["specId"]
            },
        )
  • The 'getSpec' tool is registered in the register_all_tools() function as GetSpecTool() on line 1866.
    GetSpecTool(),
  • ToolHandler is the abstract base class that GetSpecTool extends. It provides the abstract interface with get_tool_description() and run_tool() 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
Behavior2/5

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

The description does not disclose any behavioral traits beyond the input schema. Without annotations, the agent lacks information about side effects, permissions, or what 'information' is returned, which is insufficient for a read operation.

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 a single, front-loaded sentence with no redundant information. It is appropriately concise for a simple getter tool.

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?

Given the lack of an output schema and the presence of many sibling tools, the description should provide more context about what 'information' is returned. It does not, leaving the agent underinformed.

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 a description 'Spec ID' for the single parameter. The description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states 'Gets information about an API specification,' using a specific verb and resource. However, it does not distinguish 'getSpec' from sibling tools like 'getSpecDefinition' or 'getSpecFiles', which could cause confusion.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. Given the many sibling tools with similar names (e.g., 'getAllSpecs', 'getSpecDefinition'), explicit usage context is missing.

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