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

interactionsSetRestrictionsForRepo

Set interaction restrictions for a repository

Details

  • Method: PUT
  • Path: /repos/{owner}/{repo}/interaction-limits
  • Operation ID: interactions/set-restrictions-for-repo

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"
  },
  "limit": {
    "description": "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.",
    "required": true,
    "location": "body",
    "type": "string",
    "enum": [
      "existing_users",
      "contributors_only",
      "collaborators_only"
    ]
  },
  "expiry": {
    "description": "The duration of the interaction restriction. Default: `one_day`.",
    "required": false,
    "location": "body",
    "type": "string",
    "enum": [
      "one_day",
      "three_days",
      "one_week",
      "one_month",
      "six_months"
    ]
  }
}

Response Schema

{
  "title": "Interaction Limits",
  "description": "Interaction limit settings.",
  "type": "object",
  "properties": {
    "limit": {
      "type": "string",
      "description": "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect.",
      "example": "collaborators_only",
      "enum": [
        "existing_users",
        "contributors_only",
        "collaborators_only"
      ]
    },
    "origin": {
      "type": "string",
      "example": "repository"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "example": "2018-08-17T04:18:39Z"
    }
  },
  "required": [
    "limit",
    "origin",
    "expires_at"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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