Generate Project Business Policy JavaScript
post
/ic/api/integration/v1/projects/{projectId}/mcp/policies/business/actions/generate
Generates JavaScript for a project MCP business policy from a selected MCP server tool and free-text business rule prompt.
Request
Path Parameters
-
projectId(required): string
Project identifierExample:
MCP_PROJECT
Query Parameters
-
integrationInstance(required): string
This is the name of the service instance. You can get this value from the About page where it is specified in the Service instance field.Example:
example-instance
Supported Media Types
- application/json; charset=utf-8
Root Schema : schema
Type:
objectBusiness policy JavaScript generation request.
Show Source
-
prompt(required): string
Free-text business policy requirements.
-
serverId(required): string
Project MCP server id.
-
toolName(required): string
MCP tool name exposed by the selected server.
Response
Supported Media Types
- application/json; charset=utf-8
200 Response
Successful operation
Root Schema : MCPBusinessPolicyGenerateResponseRs
Type:
objectGenerated business policy JavaScript response.
Show Source
-
config: object
config
Additional Properties Allowed:
truePolicy-type-specific configuration. Its required fields depend on the policy type. -
javascript: string
Generated business policy JavaScript.
-
serverId: string
Identifier of the project MCP server.
-
toolName: string
Name of the selected MCP server tool.
-
warnings: array
warnings
Warnings produced while generating the policy.
Nested Schema : config
Type:
objectAdditional Properties Allowed:
truePolicy-type-specific configuration. Its required fields depend on the policy type.
400 Response
Malformed parameters
401 Response
Unauthorized or insufficient design-time permissions
404 Response
Project or resource not found, or the MCP feature is not available
500 Response
Server error
Examples
The following example shows how to generate JavaScript for a project MCP business policy from a selected MCP server tool and a free-text business rule prompt by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL. For more information about endpoint URL structure, see Send Requests.
Example: Generate Project Business Policy JavaScript
curl --request POST --include \
--url "${BASE_URL}/ic/api/integration/v1/projects/${PROJECT_ID}/mcp/policies/business/actions/generate?integrationInstance=${INTEGRATION_INSTANCE}" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/json" \
--header "Content-Type: application/json; charset=utf-8" \
--data-raw '{
"serverId": "MCP_SERVER",
"toolName": "get_weather",
"prompt": "Allow the request only when the city argument is non-empty. Otherwise deny the request."
}'