> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Integration for AI Agents & Workflows

> GitHub repository and code management platform

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img className="block dark:hidden" src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/github-light.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=99e5a7f245fbb5fc91ccf6fa811db22e" alt="GitHub logo" width="72" height="72" data-path="logos/github-light.svg" />

<img className="hidden dark:block" src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/github-dark.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=81aeaaaec2d8c2349e91ed0329f15025" alt="GitHub logo" width="72" height="72" data-path="logos/github-dark.svg" />

## Overview

Add **GitHub** to any ModuleX agent or workflow. Repository, issue, pull request, branch, commit, and code search actions against the GitHub REST API (v3, `api.github.com`).

<Info>
  **Categories**: Developer Tools & Infrastructure · Version Control · Productivity · **Auth**: OAuth2, Personal Access Token · **Actions**: 16
</Info>

## Authentication

<Tabs>
  <Tab title="OAuth2">
    ### OAuth2 Authentication

    Connect using GitHub OAuth (recommended for most use cases)

    #### Required Credentials

    | Field         | Description                    | Required | Format                                     |
    | ------------- | ------------------------------ | -------- | ------------------------------------------ |
    | Client ID     | GitHub OAuth App Client ID     | Yes      | `Iv1.xxxxxxxxxxxxxxxx`                     |
    | Client Secret | GitHub OAuth App Client Secret | Yes      | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |

    #### OAuth Configuration

    * **Authorization URL**: `https://github.com/login/oauth/authorize`
    * **Token URL**: `https://github.com/login/oauth/access_token`
    * **Scopes**: `repo`, `user`, `read:org`, `workflow`
  </Tab>

  <Tab title="Personal Access Token">
    ### Personal Access Token

    Use your GitHub Personal Access Token (Classic or Fine-grained)

    <Steps>
      <Step title="Step 1">
        Go to GitHub Settings → Developer settings → Personal access tokens
      </Step>

      <Step title="Step 2">
        Choose 'Tokens (classic)' OR 'Fine-grained tokens (Beta)'
      </Step>

      <Step title="Step 3">
        Click 'Generate new token'
      </Step>

      <Step title="Step 4">
        For Classic: Select scopes (repo, user, read:org, workflow)
      </Step>

      <Step title="Step 5">
        For Fine-grained: Set repository access and permissions
      </Step>

      <Step title="Step 6">
        Copy the generated token
      </Step>
    </Steps>

    #### Required Credentials

    | Field                 | Description                                                                             | Required | Format                                     |
    | --------------------- | --------------------------------------------------------------------------------------- | -------- | ------------------------------------------ |
    | Personal Access Token | Your GitHub Personal Access Token (Classic: ghp\_xxx or Fine-grained: github\_pat\_xxx) | Yes      | `ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
  </Tab>
</Tabs>

## Available Actions

<AccordionGroup>
  <Accordion title="list_repositories — List repositories for the authenticated user or organization">
    ### Parameters

    <ResponseField name="visibility" type="string">
      Filter by visibility: all, public, private (Default: `all`)
    </ResponseField>

    <ResponseField name="sort" type="string">
      Sort by: created, updated, pushed, full\_name (Default: `full_name`)
    </ResponseField>

    <ResponseField name="per_page" type="integer">
      Results per page (max 100) (Default: `30`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "RepositorySummary": {
          "additionalProperties": false,
          "description": "One row of ``list_repositories``.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "full_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Full Name"
            },
            "description": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Description"
            },
            "private": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Private"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "clone_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Clone Url"
            },
            "ssh_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Ssh Url"
            },
            "language": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Language"
            },
            "stars": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Stars"
            },
            "forks": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Forks"
            },
            "open_issues": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Open Issues"
            },
            "default_branch": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Default Branch"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            }
          },
          "title": "RepositorySummary",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "repositories": {
          "items": {
            "$ref": "#/$defs/RepositorySummary"
          },
          "title": "Repositories",
          "type": "array"
        },
        "total": {
          "default": 0,
          "title": "Total",
          "type": "integer"
        },
        "page": {
          "default": 1,
          "title": "Page",
          "type": "integer"
        },
        "per_page": {
          "default": 30,
          "title": "Per Page",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "ListRepositoriesOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_repository — Create a new repository">
    ### Parameters

    <ResponseField name="name" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="description" type="string">
      Repository description
    </ResponseField>

    <ResponseField name="private" type="boolean">
      Whether the repository is private (Default: `false`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "RepositoryCreated": {
          "additionalProperties": false,
          "description": "Repository representation from ``create_repository``.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "full_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Full Name"
            },
            "owner": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Owner"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "clone_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Clone Url"
            },
            "private": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Private"
            },
            "default_branch": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Default Branch"
            }
          },
          "title": "RepositoryCreated",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "repository": {
          "$ref": "#/$defs/RepositoryCreated"
        }
      },
      "required": [
        "success",
        "repository"
      ],
      "title": "CreateRepositoryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="delete_repository — Delete a repository (irreversible, requires delete_repo scope)">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner (username or organization)
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name to delete
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "message": {
          "title": "Message",
          "type": "string"
        }
      },
      "required": [
        "success",
        "message"
      ],
      "title": "DeleteRepositoryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_repository — Get repository details">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "RepositoryDetailed": {
          "additionalProperties": false,
          "description": "Repository representation from ``get_repository``.",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "full_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Full Name"
            },
            "description": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Description"
            },
            "private": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Private"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "clone_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Clone Url"
            },
            "ssh_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Ssh Url"
            },
            "language": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Language"
            },
            "stars": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Stars"
            },
            "forks": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Forks"
            },
            "watchers": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Watchers"
            },
            "open_issues": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Open Issues"
            },
            "default_branch": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Default Branch"
            },
            "topics": {
              "items": {
                "type": "string"
              },
              "title": "Topics",
              "type": "array"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            },
            "pushed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Pushed At"
            }
          },
          "title": "RepositoryDetailed",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "repository": {
          "$ref": "#/$defs/RepositoryDetailed"
        }
      },
      "required": [
        "success",
        "repository"
      ],
      "title": "GetRepositoryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="list_issues — List issues for a repository">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="state" type="string">
      Issue state: open, closed, all (Default: `open`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "IssueSummary": {
          "additionalProperties": false,
          "description": "Issue row in ``list_issues`` / single fetch in ``get_issue``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "user": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "User"
            },
            "labels": {
              "items": {
                "type": "string"
              },
              "title": "Labels",
              "type": "array"
            },
            "assignees": {
              "items": {
                "type": "string"
              },
              "title": "Assignees",
              "type": "array"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            },
            "closed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Closed At"
            },
            "comments": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Comments"
            }
          },
          "title": "IssueSummary",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "issues": {
          "items": {
            "$ref": "#/$defs/IssueSummary"
          },
          "title": "Issues",
          "type": "array"
        },
        "total": {
          "default": 0,
          "title": "Total",
          "type": "integer"
        },
        "page": {
          "default": 1,
          "title": "Page",
          "type": "integer"
        },
        "per_page": {
          "default": 30,
          "title": "Per Page",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "ListIssuesOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_issue — Create a new issue">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="title" type="string" required>
      Issue title
    </ResponseField>

    <ResponseField name="body" type="string">
      Issue body
    </ResponseField>

    <ResponseField name="labels" type="array">
      Issue labels
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "IssueCreated": {
          "additionalProperties": false,
          "description": "Issue representation from ``create_issue``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            }
          },
          "title": "IssueCreated",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "issue": {
          "$ref": "#/$defs/IssueCreated"
        }
      },
      "required": [
        "success",
        "issue"
      ],
      "title": "CreateIssueOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_issue — Get issue details">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="issue_number" type="integer" required>
      Issue number
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "IssueSummary": {
          "additionalProperties": false,
          "description": "Issue row in ``list_issues`` / single fetch in ``get_issue``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "user": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "User"
            },
            "labels": {
              "items": {
                "type": "string"
              },
              "title": "Labels",
              "type": "array"
            },
            "assignees": {
              "items": {
                "type": "string"
              },
              "title": "Assignees",
              "type": "array"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            },
            "closed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Closed At"
            },
            "comments": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Comments"
            }
          },
          "title": "IssueSummary",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "issue": {
          "$ref": "#/$defs/IssueSummary"
        }
      },
      "required": [
        "success",
        "issue"
      ],
      "title": "GetIssueOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="update_issue — Update an existing issue">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="issue_number" type="integer" required>
      Issue number
    </ResponseField>

    <ResponseField name="title" type="string">
      Issue title
    </ResponseField>

    <ResponseField name="body" type="string">
      Issue body
    </ResponseField>

    <ResponseField name="state" type="string">
      Issue state: open or closed
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "IssueUpdated": {
          "additionalProperties": false,
          "description": "Issue representation from ``update_issue``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            }
          },
          "title": "IssueUpdated",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "issue": {
          "$ref": "#/$defs/IssueUpdated"
        }
      },
      "required": [
        "success",
        "issue"
      ],
      "title": "UpdateIssueOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="list_pull_requests — List pull requests for a repository">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="state" type="string">
      PR state: open, closed, all (Default: `open`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "PullRequestSummary": {
          "additionalProperties": false,
          "description": "PR row in ``list_pull_requests``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "user": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "User"
            },
            "head": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Head"
            },
            "base": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Base"
            },
            "draft": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Draft"
            },
            "mergeable": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Mergeable"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            },
            "merged_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Merged At"
            },
            "closed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Closed At"
            }
          },
          "title": "PullRequestSummary",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "pull_requests": {
          "items": {
            "$ref": "#/$defs/PullRequestSummary"
          },
          "title": "Pull Requests",
          "type": "array"
        },
        "total": {
          "default": 0,
          "title": "Total",
          "type": "integer"
        },
        "page": {
          "default": 1,
          "title": "Page",
          "type": "integer"
        },
        "per_page": {
          "default": 30,
          "title": "Per Page",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "ListPullRequestsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_pull_request — Create a new pull request">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="title" type="string" required>
      Pull request title
    </ResponseField>

    <ResponseField name="head" type="string" required>
      The name of the branch where your changes are implemented
    </ResponseField>

    <ResponseField name="base" type="string" required>
      The name of the branch you want the changes pulled into
    </ResponseField>

    <ResponseField name="body" type="string">
      Pull request description
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "PullRequestCreated": {
          "additionalProperties": false,
          "description": "PR representation from ``create_pull_request``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "draft": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Draft"
            },
            "head": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Head"
            },
            "base": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Base"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            }
          },
          "title": "PullRequestCreated",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "pull_request": {
          "$ref": "#/$defs/PullRequestCreated"
        }
      },
      "required": [
        "success",
        "pull_request"
      ],
      "title": "CreatePullRequestOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_pull_request — Get pull request details">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="pull_number" type="integer" required>
      Pull request number
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "PullRequestDetailed": {
          "additionalProperties": false,
          "description": "PR representation from ``get_pull_request``.",
          "properties": {
            "number": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Number"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "State"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "user": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "User"
            },
            "head": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Head"
            },
            "base": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Base"
            },
            "draft": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Draft"
            },
            "mergeable": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Mergeable"
            },
            "merged": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Merged"
            },
            "created_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created At"
            },
            "updated_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated At"
            },
            "merged_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Merged At"
            },
            "closed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Closed At"
            },
            "commits": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Commits"
            },
            "additions": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Additions"
            },
            "deletions": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Deletions"
            },
            "changed_files": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Changed Files"
            }
          },
          "title": "PullRequestDetailed",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "pull_request": {
          "$ref": "#/$defs/PullRequestDetailed"
        }
      },
      "required": [
        "success",
        "pull_request"
      ],
      "title": "GetPullRequestOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="merge_pull_request — Merge a pull request">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="pull_number" type="integer" required>
      Pull request number
    </ResponseField>

    <ResponseField name="commit_message" type="string">
      Commit message for the merge
    </ResponseField>

    <ResponseField name="merge_method" type="string">
      Merge method: merge, squash, rebase (Default: `merge`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "merged": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merged"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message"
        },
        "sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sha"
        }
      },
      "required": [
        "success"
      ],
      "title": "MergePullRequestOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_branch — Create a new branch">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="branch_name" type="string" required>
      New branch name
    </ResponseField>

    <ResponseField name="from_branch" type="string">
      Source branch (defaults to default branch)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "Branch": {
          "additionalProperties": false,
          "description": "Branch returned by ``create_branch``.",
          "properties": {
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "ref": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Ref"
            },
            "sha": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Sha"
            }
          },
          "title": "Branch",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "branch": {
          "$ref": "#/$defs/Branch"
        }
      },
      "required": [
        "success",
        "branch"
      ],
      "title": "CreateBranchOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_file_content — Get file contents from a repository">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="path" type="string" required>
      File path
    </ResponseField>

    <ResponseField name="branch" type="string">
      Branch name (defaults to default branch)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "FileContent": {
          "additionalProperties": false,
          "description": "File returned by ``get_file_content`` (content is base64-decoded UTF-8).",
          "properties": {
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "size": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Size"
            },
            "content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Content"
            },
            "sha": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Sha"
            },
            "download_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Download Url"
            }
          },
          "title": "FileContent",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "file": {
          "$ref": "#/$defs/FileContent"
        }
      },
      "required": [
        "success",
        "file"
      ],
      "title": "GetFileContentOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_commit — Create a commit with file changes">
    ### Parameters

    <ResponseField name="owner" type="string" required>
      Repository owner
    </ResponseField>

    <ResponseField name="repo" type="string" required>
      Repository name
    </ResponseField>

    <ResponseField name="branch" type="string" required>
      Branch name
    </ResponseField>

    <ResponseField name="message" type="string" required>
      Commit message
    </ResponseField>

    <ResponseField name="files" type="array" required>
      Array of file objects with path and content
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "CommitCreated": {
          "additionalProperties": false,
          "description": "Commit returned by ``create_commit``.",
          "properties": {
            "sha": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Sha"
            },
            "message": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Message"
            },
            "branch": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Branch"
            }
          },
          "title": "CommitCreated",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "commit": {
          "$ref": "#/$defs/CommitCreated"
        }
      },
      "required": [
        "success",
        "commit"
      ],
      "title": "CreateCommitOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="search_code — Search for code in repositories">
    ### Parameters

    <ResponseField name="query" type="string" required>
      Search query
    </ResponseField>

    <ResponseField name="sort" type="string">
      Sort by: indexed (default) (Default: `indexed`)
    </ResponseField>

    <ResponseField name="per_page" type="integer">
      Results per page (max 100) (Default: `30`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "SearchCodeItem": {
          "additionalProperties": false,
          "description": "One result row of ``search_code``.",
          "properties": {
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "repository": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Repository"
            },
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "sha": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Sha"
            }
          },
          "title": "SearchCodeItem",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "total_count": {
          "default": 0,
          "title": "Total Count",
          "type": "integer"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/SearchCodeItem"
          },
          "title": "Items",
          "type": "array"
        },
        "page": {
          "default": 1,
          "title": "Page",
          "type": "integer"
        },
        "per_page": {
          "default": 30,
          "title": "Per Page",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "SearchCodeOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* **Authenticated REST API:** 5,000 requests per hour per token.
* **Search API** (`search_code`): 30 requests per minute, separate
  quota — and `q` must be at least one valid qualifier (e.g.
  `repo:owner/name` or `language:python`).
* **`create_commit`** makes five sequential API calls (ref, base commit,
  one blob per file, tree, commit, ref update). Budget accordingly when
  committing many files.
* **`delete_repository`** is irreversible and requires the token to
  carry the `delete_repo` scope; Fine-grained tokens additionally need
  the *Administration: write* permission.

## Related integrations

<CardGroup cols={3}>
  <Card title="GitLab" href="/integrations/tools/gitlab" />

  <Card title="Greptile" href="/integrations/tools/greptile" />

  <Card title="Algolia" href="/integrations/tools/algolia" />
</CardGroup>

## Links

* [GitHub](https://github.com)
