Skip to main content
Glama
ElonJask

ProxyPin MCP Server

by ElonJask

analyze_api

Analyze API structure for a domain to understand endpoints, methods, and parameters from captured HTTP traffic.

Instructions

Analyze API structure for a domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The analyze_api function is a decorated tool that aggregates request information for a given domain, normalizes URL paths to identify API endpoints, and generates a structured summary of the API, including counts, authentication, and request/response structures.
    def analyze_api(domain: str) -> str:
        """Analyze API structure for a domain."""
        normalized_domain = domain.strip()
        if not normalized_domain:
            return _json_response({"error": "domain is required"})
    
        requests = reader.get_requests(
            limit=300,
            detail_level=DetailLevel.KEY,
            domain=normalized_domain,
        )
    
        endpoints: dict[str, dict[str, Any]] = {}
        for req in requests:
            path = req.path or "/"
            normalized = re.sub(r"/\d+", "/{id}", path)
            normalized = re.sub(r"/[a-f0-9-]{32,}", "/{uuid}", normalized, flags=re.IGNORECASE)
    
            key = f"{req.method} {normalized}"
            endpoint = endpoints.setdefault(
                key,
                {
                    "method": req.method,
                    "path": normalized,
                    "count": 0,
                    "statuses": set(),
                    "has_auth": False,
                    "request_structure": None,
                    "response_structure": None,
                    "sample_url": req.url,
                },
            )
            endpoint["count"] += 1
            if req.status is not None:
                endpoint["statuses"].add(req.status)
            if req.has_auth:
                endpoint["has_auth"] = True
            if req.request_body_structure and not endpoint["request_structure"]:
                endpoint["request_structure"] = req.request_body_structure
            if req.response_body_structure and not endpoint["response_structure"]:
                endpoint["response_structure"] = req.response_body_structure
    
        endpoints_list: list[dict[str, Any]] = []
        result: dict[str, Any] = {
            "domain": normalized_domain,
            "total_requests": len(requests),
            "endpoints_count": len(endpoints),
            "endpoints": endpoints_list,
        }
        for _, endpoint in sorted(endpoints.items(), key=lambda item: -item[1]["count"]):
            endpoints_list.append(
                {
                    "method": endpoint["method"],
                    "path": endpoint["path"],
                    "count": endpoint["count"],
                    "statuses": sorted(endpoint["statuses"]),
                    "has_auth": endpoint["has_auth"],
                    "request_structure": endpoint["request_structure"],
                    "response_structure": endpoint["response_structure"],
                    "sample_url": endpoint["sample_url"],
                }
            )
        return _json_response(result)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool analyzes API structure but doesn't describe what the analysis involves, such as whether it returns metadata, endpoints, or schemas, or if it has side effects like caching. This leaves key behavioral traits unspecified, making it inadequate for a tool with no annotation coverage.

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, efficient sentence with no wasted words. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly. Every part of the sentence contributes to the purpose, earning its place without redundancy.

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 the tool has 1 parameter, no annotations, and an output schema exists, the description is minimally complete but lacks depth. It states the basic action but doesn't cover behavioral aspects or parameter details. The output schema likely handles return values, so the description doesn't need to explain those, but overall it's adequate with clear gaps in guidance and transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, and the description doesn't add any semantic details about the 'domain' parameter. It doesn't explain what a domain entails, such as whether it's a URL, name, or identifier, or provide examples. With low schema coverage, the description fails to compensate, leaving the parameter meaning unclear.

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

Purpose3/5

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

The description states the tool's purpose as analyzing API structure for a domain, which is clear but vague. It specifies the verb 'analyze' and resource 'API structure,' but lacks detail on what analysis entails or how it differs from siblings like 'get_request' or 'search_requests.' No tautology is present, but it doesn't fully distinguish from alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as whether it's for high-level analysis versus detailed inspection. With siblings like 'get_domains' and 'list_requests,' there's no indication of when this tool is preferred, leaving usage ambiguous.

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/ElonJask/proxypin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server