← All MCP tools

MCP tool

approve_optimization

Approve one pending optimisation proposal after showing the user its exact budget movement, confidence, expected impact and rationale. Reallocation approvals mutate the stored plan and sandbox execution budgets, with both affected sides reforecast. Live upstream budget updates fail closed as UPSTREAM_UPDATE_UNSUPPORTED. The pending-to-approved claim is atomic and audit logged.

Input

Pass fields from this schema as the tool arguments. Runtime ownership, product scope and readiness checks still apply.

Input JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "optimizationId": {
      "type": "string",
      "minLength": 1,
      "description": "pending proposal id"
    },
    "agentStepId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "pending execute-step id that consumed the exact approved action"
    },
    "expectedActionDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 digest returned for the exact approved action"
    }
  },
  "required": [
    "optimizationId",
    "agentStepId",
    "expectedActionDigest"
  ]
}

REST mapping and authority

The tool wraps this REST endpoint. The mapping identifies path/query/body transformations and approval or idempotency headers.

Request contract
{
  "method": "POST",
  "path": "/api/v1/optimizations/{optimizationId}/approve",
  "pathFields": [
    "optimizationId"
  ],
  "pathSchema": {
    "type": "object",
    "properties": {
      "optimizationId": {
        "type": "string",
        "minLength": 1,
        "description": "pending proposal id"
      }
    },
    "additionalProperties": false,
    "required": [
      "optimizationId"
    ]
  },
  "pathEncoding": "encodeURIComponent for each path field",
  "governedAction": "optimization.approve",
  "headers": {
    "x-chorus-agent-step-id": "agentStepId",
    "x-chorus-agent-action-digest": "expectedActionDigest"
  },
  "body": null,
  "responseMapping": "REST JSON is returned as MCP structuredContent and a compatibility text block; privacy-sensitive tools validate their output schema."
}

Output

This is the registered MCP output envelope. Nested fields are only modeled where the schema explicitly defines them.

Output JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "proposal": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "proposal"
  ],
  "additionalProperties": {}
}

Safety annotations

MCP annotations
{
  "readOnlyHint": false,
  "destructiveHint": true,
  "idempotentHint": true,
  "openWorldHint": false
}

Annotations help a client present the tool. The API independently enforces authorization and exact action approvals. Error and retry guidance →

approve_optimization | AdBuyMCP docs