:// PLAINPORT
MCP · inspect_url

Inspect URL response

Resolves a public URL through bounded redirects and returns status plus a safe allowlist of HTTP headers. Use HEAD for cheap reachability/type checks and GET when a server mishandles HEAD. Use extract_metadata for HTML semantic metadata. Limit: 8 s, 5 redirects, 768 KiB only for GET.

When to use it

Resolves a public URL through bounded redirects and returns status plus a safe allowlist of HTTP headers. Use HEAD for cheap reachability/type checks and GET when a server mishandles HEAD. Use extract_metadata for HTML semantic metadata.

Input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "description": "Absolute public HTTP or HTTPS URL without embedded credentials."
    },
    "method": {
      "default": "HEAD",
      "type": "string",
      "enum": [
        "GET",
        "HEAD"
      ]
    }
  },
  "required": [
    "url",
    "method"
  ],
  "additionalProperties": false
}

Output schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "requested_url": {
          "type": "string"
        },
        "final_url": {
          "type": "string"
        },
        "method": {
          "enum": [
            "GET",
            "HEAD"
          ]
        },
        "status": {
          "type": "integer"
        },
        "status_text": {
          "type": "string"
        },
        "content_type": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "redirects": {
          "type": "array"
        },
        "bytes_read": {
          "type": "integer"
        }
      },
      "required": [
        "requested_url",
        "final_url",
        "method",
        "status",
        "headers",
        "redirects",
        "bytes_read"
      ]
    },
    "meta": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string"
        },
        "duration_ms": {
          "type": "integer"
        },
        "limits": {
          "type": "object"
        }
      },
      "required": [
        "request_id",
        "duration_ms"
      ]
    }
  },
  "required": [
    "ok",
    "data",
    "meta"
  ],
  "additionalProperties": false
}

REST example

curl -X POST https://plainport.exportitnow.workers.dev/api/v1/inspect-url \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com"}'

Example result

{
  "ok": true,
  "data": {
    "final_url": "https://example.com/",
    "status": 200,
    "content_type": "text/html",
    "redirects": []
  },
  "meta": {
    "request_id": "018f…",
    "duration_ms": 12
  }
}

Limit

8 s, 5 redirects, 768 KiB only for GET