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

dependencyGraphCreateRepositorySnapshot

Create a snapshot of dependencies for a repository

Details

  • Method: POST
  • Path: /repos/{owner}/{repo}/dependency-graph/snapshots
  • Operation ID: dependency-graph/create-repository-snapshot

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"
  },
  "version": {
    "description": "The version of the repository snapshot submission.",
    "required": true,
    "location": "body",
    "type": "integer"
  },
  "job": {
    "description": "",
    "required": true,
    "location": "body",
    "type": "object"
  },
  "sha": {
    "description": "The commit SHA associated with this dependency snapshot. Maximum length: 40 characters.",
    "required": true,
    "location": "body",
    "type": "string"
  },
  "ref": {
    "description": "The repository branch that triggered this snapshot.",
    "required": true,
    "location": "body",
    "type": "string"
  },
  "detector": {
    "description": "A description of the detector used.",
    "required": true,
    "location": "body",
    "type": "object"
  },
  "metadata": {
    "description": "User-defined metadata to store domain-specific information limited to 8 keys with scalar values.",
    "required": false,
    "location": "body",
    "type": "object"
  },
  "manifests": {
    "description": "A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies.",
    "required": false,
    "location": "body",
    "type": "object"
  },
  "scanned": {
    "description": "The time at which the snapshot was scanned.",
    "required": true,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "required": [
    "id",
    "created_at",
    "result",
    "message"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "description": "ID of the created snapshot."
    },
    "created_at": {
      "type": "string",
      "description": "The time at which the snapshot was created."
    },
    "result": {
      "type": "string",
      "description": "Either \"SUCCESS\", \"ACCEPTED\", or \"INVALID\". \"SUCCESS\" indicates that the snapshot was successfully created and the repository's dependencies were updated. \"ACCEPTED\" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. \"INVALID\" indicates that the snapshot was malformed."
    },
    "message": {
      "type": "string",
      "description": "A message providing further details about the result, such as why the dependencies were not updated."
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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