Open Context Protocol is live! 🚀 Read the launch post
codeScanningDeleteAnalysis

codeScanningDeleteAnalysis

Delete a code scanning analysis from a repository

Details

  • Method: DELETE
  • Path: /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}
  • Operation ID: code-scanning/delete-analysis

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "analysis_id": {
    "description": "The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "confirm_delete": {
    "description": "Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.`",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "title": "Analysis deletion",
  "description": "Successful deletion of a code scanning analysis",
  "type": "object",
  "properties": {
    "next_analysis_url": {
      "type": "string",
      "description": "Next deletable analysis in chain, without last analysis deletion confirmation",
      "format": "uri",
      "readOnly": true,
      "nullable": true
    },
    "confirm_delete_url": {
      "type": "string",
      "description": "Next deletable analysis in chain, with last analysis deletion confirmation",
      "format": "uri",
      "readOnly": true,
      "nullable": true
    }
  },
  "required": [
    "next_analysis_url",
    "confirm_delete_url"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('codeScanningDeleteAnalysis', {
    # Add required parameters here
})