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
