Create CORS Policy
createCorsPolicyCreates a new CORS policy by specifying all required fields (origins, methods, headers, etc.) and returns the policy ID.
Instructions
Create a new CORS policy on the global AM CorsService. All seven policy fields are required. A user-facing policyId may optionally be supplied; if omitted, AM assigns one. The policy ID is returned in the success response.
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": {
"acceptedOrigins": "<acceptedOrigins>",
"acceptedMethods": "<acceptedMethods>",
"acceptedHeaders": "<acceptedHeaders>",
"exposedHeaders": "<exposedHeaders>",
"maxAge": "<maxAge>",
"allowCredentials": "<allowCredentials>",
"enabled": "<enabled>"
},
"name": "createCorsPolicy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxAge | Yes | Preflight cache duration in seconds | |
| enabled | Yes | Whether the policy is enabled; if false, no CORS headers are added | |
| policyId | No | Optional user-facing identifier for the CORS policy. If omitted, AM assigns one. | |
| exposedHeaders | Yes | Response headers exposed to the browser | |
| acceptedHeaders | Yes | Non-simple request headers allowed during preflight | |
| acceptedMethods | Yes | HTTP methods allowed during preflight | |
| acceptedOrigins | Yes | Allowed origins (e.g. ["https://example.org"]) | |
| allowCredentials | Yes | Whether to send Access-Control-Allow-Credentials: true on responses |