Open Context Protocol is live! 🚀 Read the launch post

reposDeleteFile

Delete a file

Details

  • Method: DELETE
  • Path: /repos/{owner}/{repo}/contents/{path}
  • Operation ID: repos/delete-file

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"
  },
  "path": {
    "description": "path parameter",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "title": "File Commit",
  "description": "File Commit",
  "type": "object",
  "required": [
    "content",
    "commit"
  ],
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "sha": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "url": {
          "type": "string"
        },
        "html_url": {
          "type": "string"
        },
        "git_url": {
          "type": "string"
        },
        "download_url": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "_links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "string"
            },
            "git": {
              "type": "string"
            },
            "html": {
              "type": "string"
            }
          }
        }
      },
      "nullable": true
    },
    "commit": {
      "type": "object",
      "properties": {
        "sha": {
          "type": "string"
        },
        "node_id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "html_url": {
          "type": "string"
        },
        "author": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            }
          }
        },
        "committer": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            }
          }
        },
        "message": {
          "type": "string"
        },
        "tree": {
          "type": "object",
          "properties": {
            "url": {
              "type": "string"
            },
            "sha": {
              "type": "string"
            }
          }
        },
        "parents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "html_url": {
                "type": "string"
              },
              "sha": {
                "type": "string"
              }
            }
          }
        },
        "verification": {
          "type": "object",
          "properties": {
            "verified": {
              "type": "boolean"
            },
            "reason": {
              "type": "string"
            },
            "signature": {
              "type": "string",
              "nullable": true
            },
            "payload": {
              "type": "string",
              "nullable": true
            },
            "verified_at": {
              "type": "string",
              "nullable": true
            }
          }
        }
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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