tools:
  - name: create_or_update_file
    description: Create or update a single file in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - path
        - content
        - message
        - branch
      properties:
        sha:
          type: string
          description: SHA of the file being replaced (required when updating existing
            files)
        path:
          type: string
          description: Path where to create/update the file
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        branch:
          type: string
          description: Branch to create/update the file in
        content:
          type: string
          description: Content of the file
        message:
          type: string
          description: Commit message
      additionalProperties: false
  - name: search_repositories
    description: Search for GitHub repositories
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - query
      properties:
        page:
          type: number
          description: "Page number for pagination (default: 1)"
        query:
          type: string
          description: Search query (see GitHub search syntax)
        perPage:
          type: number
          description: "Number of results per page (default: 30, max: 100)"
      additionalProperties: false
  - name: create_repository
    description: Create a new GitHub repository in your account
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - name
      properties:
        name:
          type: string
          description: Repository name
        private:
          type: boolean
          description: Whether the repository should be private
        autoInit:
          type: boolean
          description: Initialize with README.md
        description:
          type: string
          description: Repository description
      additionalProperties: false
  - name: get_file_contents
    description: Get the contents of a file or directory from a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - path
      properties:
        path:
          type: string
          description: Path to the file or directory
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        branch:
          type: string
          description: Branch to get contents from
      additionalProperties: false
  - name: push_files
    description: Push multiple files to a GitHub repository in a single commit
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - branch
        - files
        - message
      properties:
        repo:
          type: string
          description: Repository name
        files:
          type: array
          items:
            type: object
            required:
              - path
              - content
            properties:
              path:
                type: string
              content:
                type: string
            additionalProperties: false
          description: Array of files to push
        owner:
          type: string
          description: Repository owner (username or organization)
        branch:
          type: string
          description: Branch to push to (e.g., 'main' or 'master')
        message:
          type: string
          description: Commit message
      additionalProperties: false
  - name: create_issue
    description: Create a new issue in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - title
      properties:
        body:
          type: string
        repo:
          type: string
        owner:
          type: string
        title:
          type: string
        labels:
          type: array
          items:
            type: string
        assignees:
          type: array
          items:
            type: string
        milestone:
          type: number
      additionalProperties: false
  - name: create_pull_request
    description: Create a new pull request in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - title
        - head
        - base
      properties:
        base:
          type: string
          description: The name of the branch you want the changes pulled into
        body:
          type: string
          description: Pull request body/description
        head:
          type: string
          description: The name of the branch where your changes are implemented
        repo:
          type: string
          description: Repository name
        draft:
          type: boolean
          description: Whether to create the pull request as a draft
        owner:
          type: string
          description: Repository owner (username or organization)
        title:
          type: string
          description: Pull request title
        maintainer_can_modify:
          type: boolean
          description: Whether maintainers can modify the pull request
      additionalProperties: false
  - name: fork_repository
    description: Fork a GitHub repository to your account or specified organization
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        organization:
          type: string
          description: "Optional: organization to fork to (defaults to your personal
            account)"
      additionalProperties: false
  - name: create_branch
    description: Create a new branch in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - branch
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        branch:
          type: string
          description: Name for the new branch
        from_branch:
          type: string
          description: "Optional: source branch to create from (defaults to the
            repository's default branch)"
      additionalProperties: false
  - name: list_commits
    description: Get list of commits of a branch in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
      properties:
        sha:
          type: string
        page:
          type: number
        repo:
          type: string
        owner:
          type: string
        perPage:
          type: number
      additionalProperties: false
  - name: list_issues
    description: List issues in a GitHub repository with filtering options
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
      properties:
        page:
          type: number
        repo:
          type: string
        sort:
          enum:
            - created
            - updated
            - comments
          type: string
        owner:
          type: string
        since:
          type: string
        state:
          enum:
            - open
            - closed
            - all
          type: string
        labels:
          type: array
          items:
            type: string
        per_page:
          type: number
        direction:
          enum:
            - asc
            - desc
          type: string
      additionalProperties: false
  - name: update_issue
    description: Update an existing issue in a GitHub repository
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - issue_number
      properties:
        body:
          type: string
        repo:
          type: string
        owner:
          type: string
        state:
          enum:
            - open
            - closed
          type: string
        title:
          type: string
        labels:
          type: array
          items:
            type: string
        assignees:
          type: array
          items:
            type: string
        milestone:
          type: number
        issue_number:
          type: number
      additionalProperties: false
  - name: add_issue_comment
    description: Add a comment to an existing issue
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - issue_number
        - body
      properties:
        body:
          type: string
        repo:
          type: string
        owner:
          type: string
        issue_number:
          type: number
      additionalProperties: false
  - name: search_code
    description: Search for code across GitHub repositories
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - q
      properties:
        q:
          type: string
        page:
          type: number
          minimum: 1
        order:
          enum:
            - asc
            - desc
          type: string
        per_page:
          type: number
          maximum: 100
          minimum: 1
      additionalProperties: false
  - name: search_issues
    description: Search for issues and pull requests across GitHub repositories
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - q
      properties:
        q:
          type: string
        page:
          type: number
          minimum: 1
        sort:
          enum:
            - comments
            - reactions
            - reactions-+1
            - reactions--1
            - reactions-smile
            - reactions-thinking_face
            - reactions-heart
            - reactions-tada
            - interactions
            - created
            - updated
          type: string
        order:
          enum:
            - asc
            - desc
          type: string
        per_page:
          type: number
          maximum: 100
          minimum: 1
      additionalProperties: false
  - name: search_users
    description: Search for users on GitHub
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - q
      properties:
        q:
          type: string
        page:
          type: number
          minimum: 1
        sort:
          enum:
            - followers
            - repositories
            - joined
          type: string
        order:
          enum:
            - asc
            - desc
          type: string
        per_page:
          type: number
          maximum: 100
          minimum: 1
      additionalProperties: false
  - name: get_issue
    description: Get details of a specific issue in a GitHub repository.
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - issue_number
      properties:
        repo:
          type: string
        owner:
          type: string
        issue_number:
          type: number
      additionalProperties: false
  - name: get_pull_request
    description: Get details of a specific pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: list_pull_requests
    description: List and filter repository pull requests
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
      properties:
        base:
          type: string
          description: Filter by base branch name
        head:
          type: string
          description: Filter by head user or head organization and branch name
        page:
          type: number
          description: Page number of the results
        repo:
          type: string
          description: Repository name
        sort:
          enum:
            - created
            - updated
            - popularity
            - long-running
          type: string
          description: What to sort results by
        owner:
          type: string
          description: Repository owner (username or organization)
        state:
          enum:
            - open
            - closed
            - all
          type: string
          description: State of the pull requests to return
        per_page:
          type: number
          description: Results per page (max 100)
        direction:
          enum:
            - asc
            - desc
          type: string
          description: The direction of the sort
      additionalProperties: false
  - name: create_pull_request_review
    description: Create a review on a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
        - body
        - event
      properties:
        body:
          type: string
          description: The body text of the review
        repo:
          type: string
          description: Repository name
        event:
          enum:
            - APPROVE
            - REQUEST_CHANGES
            - COMMENT
          type: string
          description: The review action to perform
        owner:
          type: string
          description: Repository owner (username or organization)
        comments:
          type: array
          items:
            type: object
            required:
              - path
              - position
              - body
            properties:
              body:
                type: string
                description: Text of the review comment
              path:
                type: string
                description: The relative path to the file being commented on
              position:
                type: number
                description: The position in the diff where you want to add a review comment
            additionalProperties: false
          description: Comments to post as part of the review
        commit_id:
          type: string
          description: The SHA of the commit that needs a review
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: merge_pull_request
    description: Merge a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
        commit_title:
          type: string
          description: Title for the automatic commit message
        merge_method:
          enum:
            - merge
            - squash
            - rebase
          type: string
          description: Merge method to use
        commit_message:
          type: string
          description: Extra detail to append to automatic commit message
      additionalProperties: false
  - name: get_pull_request_files
    description: Get the list of files changed in a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: get_pull_request_status
    description: Get the combined status of all status checks for a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: update_pull_request_branch
    description: Update a pull request branch with the latest changes from the base branch
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
        expected_head_sha:
          type: string
          description: The expected SHA of the pull request's HEAD ref
      additionalProperties: false
  - name: get_pull_request_comments
    description: Get the review comments on a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: get_pull_request_reviews
    description: Get the reviews on a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: add_pull_request_comment
    description: Add a review comment to a specific line in a pull request
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
        - body
        - commit_id
        - path
        - position
      properties:
        body:
          type: string
          description: The text of the comment
        path:
          type: string
          description: The relative path to the file that you want to comment on
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        position:
          type: number
          description: The position in the diff where you want to add a comment
        commit_id:
          type: string
          description: The SHA of the commit to comment on
        diff_hunk:
          type: string
          description: The diff hunk of the file where the comment should be placed
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: update_pull_request
    description: Update an existing pull request (title, body, state, etc.)
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
      properties:
        base:
          type: string
          description: The name of the branch you want the changes pulled into
        body:
          type: string
          description: The contents of the pull request
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        state:
          enum:
            - open
            - closed
          type: string
          description: State of the pull request
        title:
          type: string
          description: The title of the pull request
        pull_number:
          type: number
          description: Pull request number
        maintainer_can_modify:
          type: boolean
          description: Whether maintainers can modify the pull request
      additionalProperties: false
  - name: reply_to_pull_request_comment
    description: Reply to an existing pull request comment
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - comment_id
        - body
      properties:
        body:
          type: string
          description: The text of the reply
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        comment_id:
          type: number
          description: The ID of the comment to reply to
      additionalProperties: false
  - name: resolve_pull_request_conversation
    description: Resolve a pull request comment thread/conversation
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - comment_id
        - thread_id
      properties:
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        thread_id:
          type: string
          description: The ID of the thread to resolve
        comment_id:
          type: number
          description: The ID of the comment thread to resolve
      additionalProperties: false
  - name: add_pull_request_issue_comment
    description: Add a general comment to a pull request (not on a specific line)
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - pull_number
        - body
      properties:
        body:
          type: string
          description: The text of the comment
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        pull_number:
          type: number
          description: Pull request number
      additionalProperties: false
  - name: update_pull_request_comment
    description: Edit an existing pull request comment
    inputSchema:
      type: object
      $schema: http://json-schema.org/draft-07/schema#
      required:
        - owner
        - repo
        - comment_id
        - body
      properties:
        body:
          type: string
          description: The new text of the comment
        repo:
          type: string
          description: Repository name
        owner:
          type: string
          description: Repository owner (username or organization)
        comment_id:
          type: number
          description: The ID of the comment to update
      additionalProperties: false
