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

reposCreateTagProtection

Closing down - Create a tag protection state for a repository

Details

  • Method: POST
  • Path: /repos/{owner}/{repo}/tags/protection
  • Operation ID: repos/create-tag-protection

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"
  },
  "pattern": {
    "description": "An optional glob pattern to match against when enforcing tag protection.",
    "required": true,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "title": "Tag protection",
  "description": "Tag protection",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "example": 2
    },
    "created_at": {
      "type": "string",
      "example": "2011-01-26T19:01:12Z"
    },
    "updated_at": {
      "type": "string",
      "example": "2011-01-26T19:01:12Z"
    },
    "enabled": {
      "type": "boolean",
      "example": true
    },
    "pattern": {
      "type": "string",
      "example": "v1.*"
    }
  },
  "required": [
    "pattern"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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