Check whether a browser would allow a cross-origin API call (CORS)
border_check_corsUse when the user hits a CORS error ("blocked by CORS policy", "No 'Access-Control-Allow-Origin' header", "preflight", "Failed to fetch" from a frontend) or is about to call a public API from browser code (React, Next.js, Vue, a browser extension page) and asks whether it will work (signals: "CORS", "works in Postman but not in the browser", "preflight 401/404", "Access-Control-Allow-Headers", "withCredentials", "credentials include"). Sends the browser's own preflight (OPTIONS with Origin, Access-Control-Request-Method and -Headers) to the live API and, for GET and HEAD, the request itself with the Origin header, then applies the Fetch standard CORS rules as Chrome implements them. Returns verdict (allowed, blocked, preflight_passed, incomplete, same_origin, unreachable), the exact Chrome console error, which step fails (preflight or response) and why, whether a preflight is needed and why, the CORS headers the server sent, warnings (missing Vary: Origin, a server that echoes any origin with credentials, unreadable response headers, Authorization covered only by *), the exact response headers that fix it, and curl commands to reproduce. Example: {"url":"https://api.example.com/v1/items","origin":"http://localhost:3000","method":"POST","headers":["Content-Type: application/json","Authorization"],"credentials":true}. Limits: public http/https APIs on ports 80 and 443 only (localhost, private and staging servers go through border_check_cors_headers with pasted curl output); never sends POST, PUT, PATCH or DELETE (those get the preflight checked only) and never sends header values for Authorization or keys; a server can answer differently to a real browser session.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>",
"origin": "<origin>"
},
"name": "border_check_cors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The API address the page calls, for example "https://api.example.com/v1/items". | |
| method | No | HTTP method the page uses (default GET), for example "POST", "PUT", "PATCH" or "DELETE". | |
| origin | Yes | The origin of the page that makes the request: scheme, host and port, for example "https://app.example.com" or "http://localhost:5173". A full page URL is reduced to its origin. | |
| headers | No | Request headers the page sets in fetch() or axios, as "Name" or "Name: value". Values matter only for Content-Type, Accept, Accept-Language, Content-Language and Range; give names alone for Authorization and API keys. Example: ["Content-Type: application/json","Authorization"]. | |
| credentials | No | true when the request sends cookies: fetch credentials: "include", XHR or axios withCredentials: true. Default false. | |
| read_headers | No | Response headers the page code reads with response.headers.get(), for example ["X-Total-Count","ETag"]. Checked against Access-Control-Expose-Headers. |