fetch_url_metadata
Fetch a URL to inspect its status code, content type, length, and response time. Handles HTTP errors like 404 as data, only raising on transport failures.
Instructions
Fetch a URL and report its status code, content type/length, and response time.
Does not raise on HTTP error status codes (4xx/5xx) -- those come back as data, since a 404 is a valid answer to "what does this URL return?". Only transport-level failures (timeout, DNS, connection refused, bad scheme) raise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The http/https URL to check. | |
| timeout_seconds | No | Request timeout in seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The final URL after following redirects. | |
| status_code | Yes | HTTP status code returned by the server. | |
| content_type | No | Value of the Content-Type header, if present. | |
| response_time_ms | Yes | Round-trip time for the request, in milliseconds. | |
| content_length_bytes | No | Value of the Content-Length header, if present. |