Skip to main content
Glama

Check pasted preflight and response headers against the CORS rules

border_check_cors_headers
Read-onlyIdempotent

Use when a CORS problem involves a server Border cannot reach (localhost, a dev or staging server, a private network, a custom port) or a POST, PUT, PATCH or DELETE whose real response needs checking, and the raw response headers are available from curl -i or the browser DevTools Network tab (signals: "here is the OPTIONS response", "my local API returns these headers", "CORS works on localhost but not in production", "preflight response is"). Parses the pasted OPTIONS response and/or the actual response (status line plus headers; curl -i, curl -v, curl -iL with redirects, and DevTools copies are all read) and applies the Fetch standard CORS rules as Chrome implements them, for the given page origin, method, request headers and credentials mode. Returns the same result as border_check_cors: verdict, the exact Chrome console error, the failing step and reason, warnings, the response headers that fix it, and the curl commands to capture any missing response. Nothing is fetched. Example: {"url":"http://localhost:8000/api/login","origin":"http://localhost:5173","method":"POST","headers":["Content-Type: application/json"],"credentials":true,"preflight_response":"HTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Headers: content-type"}. Limits: the verdict is only as complete as the pasted headers; a preflighted request needs both pastes for a full answer.

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_headers"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe API address the page calls, for example "https://api.example.com/v1/items".
methodNoHTTP method the page uses (default GET), for example "POST", "PUT", "PATCH" or "DELETE".
originYesThe 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.
headersNoRequest 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"].
responseNoThe raw response to the actual request: status line and headers from curl -i (curl -iL output with redirects is read hop by hop) or DevTools. Bodies are ignored.
credentialsNotrue when the request sends cookies: fetch credentials: "include", XHR or axios withCredentials: true. Default false.
read_headersNoResponse headers the page code reads with response.headers.get(), for example ["X-Total-Count","ETag"]. Checked against Access-Control-Expose-Headers.
preflight_responseNoThe raw OPTIONS (preflight) response: status line and headers, as printed by curl -i -X OPTIONS (see the curl.preflight command in any result) or copied from DevTools.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false and idempotentHint=true, so the safety profile is covered; the description adds substantial context anyway. It says "Nothing is fetched", enumerates accepted paste formats (curl -i, curl -v, curl -iL hop by hop, DevTools copies, bodies ignored), describes the return payload (verdict, exact Chrome console error, failing step and reason, warnings, fixing headers, curl commands), and discloses the key limitation that the verdict is only as complete as the pasted headers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the triggering condition, followed by mechanism, return shape, one compact JSON example and a Limits line — a sensible ordering with little dead weight. The long parenthetical of quoted user signals and the nested format list make it denser than necessary, but each element remains functional.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter, no-output-schema tool this covers everything an agent needs: when to pick it over border_check_cors, what input formats are accepted, what comes back, and how incomplete pastes degrade the answer. Annotations plus the return-value summary close the gaps that the absence of an output schema would otherwise leave.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds cross-parameter meaning the schema cannot express: the worked example shows how url, origin, method, headers, credentials and preflight_response compose into one call, and the Limits sentence explains that a preflighted request needs both pastes for a full answer. That is genuine assembly-level guidance beyond the per-field descriptions.

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

Purpose5/5

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

States a specific verb and resource: parses a pasted OPTIONS/actual response and applies the Fetch-standard CORS rules as Chrome implements them, for a given origin, method, headers and credentials mode. It also names the sibling border_check_cors and the exact relationship (same verdict, but this one uses pasted headers instead of reaching the server), so an agent can route between them without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use conditions: a server Border cannot reach (localhost, dev/staging, private network, custom port) or a POST/PUT/PATCH/DELETE whose real response must be checked. It reinforces this with quoted user signals ("here is the OPTIONS response", "CORS works on localhost but not in production") and states the prerequisite (raw headers available from curl -i or DevTools).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources