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

reposCodeownersErrors

List CODEOWNERS errors

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/codeowners/errors
  • Operation ID: repos/codeowners-errors

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"
  },
  "ref": {
    "description": "A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. Default: the repository's default branch (e.g. `main`)",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "title": "CODEOWNERS errors",
  "description": "A list of errors found in a repo's CODEOWNERS file",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "line": {
            "description": "The line number where this errors occurs.",
            "type": "integer",
            "example": 7
          },
          "column": {
            "description": "The column number where this errors occurs.",
            "type": "integer",
            "example": 3
          },
          "source": {
            "description": "The contents of the line where the error occurs.",
            "type": "string",
            "example": "* user"
          },
          "kind": {
            "description": "The type of error.",
            "type": "string",
            "example": "Invalid owner"
          },
          "suggestion": {
            "description": "Suggested action to fix the error. This will usually be `null`, but is provided for some common errors.",
            "type": "string",
            "nullable": true,
            "example": "The pattern `/` will never match anything, did you mean `*` instead?"
          },
          "message": {
            "description": "A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting).",
            "type": "string",
            "example": "Invalid owner on line 7:\n\n  * user\n    ^"
          },
          "path": {
            "description": "The path of the file where the error occured.",
            "type": "string",
            "example": ".github/CODEOWNERS"
          }
        },
        "required": [
          "line",
          "column",
          "kind",
          "message",
          "path"
        ]
      }
    }
  },
  "required": [
    "errors"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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