Skip to main content

Overview

Tool Name

Purpose

The github_connector_tools enable direct integration between Genesis Data Agents and GitHub repositories. Manage repositories, files, branches, pull requests, and workflows programmatically—all within your data agent conversations. Perfect for automated documentation, code generation, data pipeline versioning, and collaborative data projects. When a governed GitHub write is refused by GitHub itself, Genesis reports the action as not_applied and preserves GitHub’s error message for the reviewer. An error after the write was sent, including an uncertain response, remains ambiguous; do not retry until the action is reconciled. For GitHub-specific actions, read-back uses the resolved GitHub credential, and Genesis confirms a child-resource change only when its repository is visible to that credential. A GitHub 404 is inconclusive because the repository may be private or missing. Core git_action writes use the Git transport and cannot currently prove that read-back uses the same credential, so an uncertain result remains reconciliation_required rather than being automatically confirmed.

Functions Available

  1. git_action: Core Git operations including repository management, branching, committing, and history tracking.
  2. file: File operations for reading, writing, searching, and managing repository content.
  3. git_action (GitHub-specific actions): GitHub platform features including pull requests, remote repository management, and credential storage.

Key Features

Repository Management

Clone, create, list, and delete repositories with full version control integration.

Branch Operations

Create, switch, merge branches and manage parallel development workflows.

Pull Request Automation

Create, review, merge, and close pull requests programmatically for collaborative workflows.

File Management

Read, write, search, copy, move, and delete files with pattern matching and bulk operations.

Commit History

Access commit logs, fetch history, and track changes across repository timelines.

Secure Authentication

Store GitHub credentials securely with support for Personal Access Tokens (PAT).

Input Parameters for Each Function

git_action

Parameters

file

Parameters
Use repo_id consistently across git_action and file operations to work within the same repository context. List available repos with git_action(action="list_repos").
Transferring existing files. When the source already lives in a repository, use file(action="copy") or file(action="move") for byte-exact server-side transfer — never read a file and write the same bytes back. For inline or generated binary content that is not already on disk, write base64 with is_base64=true. Without is_base64=true, the base64 string is written as literal ASCII text and the file is corrupt. For write_multiple, set is_base64 inside each files[] item rather than at the top level. See Git Action Tools for examples.
With git_action(action="list_repos", details=True), Genesis always returns has_remote as true or false so agents can filter cleanly. When a remote exists, remote_url is credentials-redacted and clone_source is set when Genesis can infer github, gitlab, bitbucket, or azure_devops. Use include_paths=True to add path to each detail row.
file(action="read") supports partial and targeted reads with start_line, end_line, max_lines, start_byte, max_bytes, end_byte, tail_bytes, max_chars, search_pattern, context_lines_before, context_lines_after, max_matches, return_line_numbers, encoding, force_text, and return_base64. file(action="read_multiple") forwards the same controls per file entry. When the target is a managed GitHub repo base checkout, Genesis reads remote truth instead of the shared local clone when the checkout has a git remote. Pass branch_name to read that ref on origin; omit it to read the managed default branch. When the checkout has no git remote, Genesis reads the local tree and includes freshness_notice (see Git Action Tools). On the origin-backed remote-read path, start_line, end_line, max_lines, and return_base64 are supported, but search_pattern, context_lines_before, context_lines_after, max_matches, start_byte, end_byte, max_bytes, tail_bytes, max_chars, return_line_numbers, force_text, and encoding return an explicit error. Binary content on the remote-read path must use return_base64=true.
Extremely large single-file reads follow the same guardrail as git_action: when git_action(action="read_file"), file(action="read"), or file(action="inspect_structured_data") exceeds the file-read inline budget (default 262,144 bytes / 256 KB, configurable with GENESIS_TOOL_OUTPUT_FILE_READ_BUDGET), Genesis returns tool_output_capped, preview, truncation_info, full_output_ref, and agent_guidance. When full_output_ref is not null, the full text is saved under truncated_tool_outputs/<thread_id>/... in the apps BotGit repo and can be paged back with file(action="read", file_path=full_output_ref, repo_id="apps", start_byte=0, max_bytes=N), continuing from each response’s continuation.next_start_byte. The byte range is the shape that returns the saved copy exactly as written; the whole-file and line-window paths read in text mode and rewrite line endings.

Use Cases

  1. Automated Documentation Generate and commit data dictionaries, analysis reports, or pipeline documentation directly to GitHub repositories.
  2. Code Generation & Versioning Create dbt models, SQL scripts, or Python notebooks and version them in GitHub for team collaboration.
  3. Data Pipeline Deployment Clone configuration repositories, update parameters, commit changes, and create pull requests for review.
  4. Collaborative Data Projects Share analysis notebooks, datasets, and findings with team members through structured GitHub workflows.
  5. Backup & Disaster Recovery Automatically commit critical configurations, metadata, and artifacts to GitHub for version-controlled backups.

Workflow/How It Works

  1. Step 1: Authenticate with GitHub Store GitHub credentials securely using Personal Access Token:
  2. Step 2: Create or Clone Repository Start with a new repository or clone an existing one:
Add branch_name="release/2026.05" to clone and check out a non-default branch in one call. Unless you override them, shallow and single_branch both default to true; set depth=0 for full history.
  1. Step 3: Manage Files Create, read, and organize files within the repository:
  2. Step 4: Commit Changes Track changes with descriptive commit messages:
git_action(action="commit") also accepts optional co_authors, for example ["Jane Doe <[email protected]>"], to append explicit Co-authored-by: trailers without changing the primary commit author.
  1. Step 5: Create Pull Request Collaborate with team through pull requests:
  2. Step 6: Push to GitHub Sync local changes to remote repository:

Integration Relevance

  • project_manager_tools to track data projects and link GitHub repositories to missions.
  • data_connector_tools to export analysis results and commit them to version control.
  • dbt_action to manage dbt projects in GitHub with full version control.
  • file_manager_tools to organize artifacts before committing to repositories.
  • slack_tools to notify teams when pull requests are created or commits are pushed.

Configuration Details

  • Personal Access Token: Generate from GitHub Settings → Developer settings → Personal access tokens. Required scopes: repo, workflow.
  • Enterprise URL (enterprise_url): Optional on saved GitHub connections (PAT, User OAuth, and GitHub App). Leave blank for public github.com. Set to your GitHub Enterprise Server hostname (for example https://github.mycompany.com) when repositories and API calls target a self-hosted instance. A blank Enterprise URL uses the server’s default GitHub address, which is public GitHub unless the server was started with its own. On a server whose default is public GitHub, a github.com address (such as an organisation page) is refused when the connection is saved, because it would be ignored and cannot select an organisation; on a server whose default is a GitHub Enterprise Server, blank means that server, and a github.com address selects public GitHub and is accepted. Connections already saved with a github.com address keep working against api.github.com, and Genesis appends /api/v3 only for Enterprise Server hosts.
  • Git Commit Author (git_author_mode): Optional select field on the saved GitHub connection. Default: genesis_bot. Supported values: genesis_bot, authenticated_git_user, custom.
  • Git Author Name (git_author_name) and Git Author Email (git_author_email): Optional string fields on the saved GitHub connection. Genesis shows them only when git_author_mode="custom", and both are required together in that mode. For GitHub App connections, use custom when you need a fixed verified author identity.
  • Repository Naming: Use lowercase with hyphens (e.g., data-pipeline-prod) for consistency.
  • Branch Strategy: Use feature branches (feature/, bugfix/) for changes; protect main branch.
  • Commit Messages: Follow conventional commits format: feat:, fix:, docs:, refactor:.
  • File Paths: Always use forward slashes (/) and relative paths without leading slash.
  • Large Files: GitHub has 100MB file size limit; use Git LFS for larger artifacts or store in data platforms.
Never commit sensitive credentials, API keys, or passwords to GitHub repositories. Use environment variables or secret management systems instead.

Limitations or Notes

  1. File Size Limits: GitHub limits individual files to 100MB; repositories to 1GB recommended size.
  2. API Rate Limits: GitHub API has rate limits (5,000 requests/hour for authenticated users); batch operations when possible.
  3. Private and Internal Repository Access: Requires appropriate permissions and PAT scopes for non-public repos.
  4. Binary Files: Git is optimized for text files; large binary files can slow repository performance.
  5. Merge Conflicts: Automatic merging may fail with conflicts; manual resolution required.
  6. Branch Protection: Protected branches may prevent direct pushes; use pull requests instead.
  7. Network Dependency: All operations require internet connectivity to GitHub servers.

Supported Actions

✅ clone_repo - Clone repository from GitHub URL
✅ create_repo - Create new local repository
✅ list_repos - Show all available repositories
✅ commit - Commit staged changes
✅ push - Push commits to remote
✅ pull - Pull changes from remote
✅ create_branch - Create new branch
✅ switch_branch - Switch to different branch
✅ get_status - Show repository status
✅ get_history - View commit history
✅ create_pull_request - Create PR on GitHub
✅ merge_pull_request - Merge PR
✅ store_github_credentials - Save authentication
✅ list_remote_repos - List repos on GitHub
✅ check_remote_repo_exists - Check whether a GitHub repository already exists
✅ create_remote_repo - Create a GitHub repository in a personal account or organization
✅ READ_FILE - Read a single file from a named GitHub branch, or the repo default branch when branch is omitted, through the GitHub Contents API
✅ file operations - Full CRUD on repository files, including batch reads with file(action="read_multiple")
For GitHub remote repository responses, use visibility instead of private when describing access to users. GitHub sets private=true for both internal and private repositories, while visibility preserves the full public / internal / private distinction.
Direct READ_FILE requires repo_name, owner, and file_path. branch is optional; when omitted, Genesis reads the repo default branch and falls back to main if the default branch is unavailable. connection is optional; when omitted, Genesis uses the caller’s effective scoped default GitHub connection (My default, then Role default). See Default connection layers. Successful responses include content, text, text_is_lossy, sha, size, encoding, ref, path, and source.
When a scoped GitHub default resolves but its saved credentials are missing or invalid (for example an empty PAT or failed GitHub App token mint), Genesis returns an error instead of silently falling back to the GITHUB_TOKEN environment variable. Genesis uses GITHUB_TOKEN only when no scoped default applies for the caller.

Not Supported

❌ Git submodules or subtrees
❌ Git LFS (Large File Storage) direct management
❌ GitHub Issues or Projects management
❌ Repository webhooks configuration
❌ GitHub Pages deployment
❌ Repository transfer or ownership changes
❌ Advanced merge strategies (squash, rebase from tool)
To execute GitHub Actions workflows, use CI Pipeline Tools.

Output

  • clone_repo: Confirmation with repository path and clone details.
  • commit: Commit hash, files changed, and commit message confirmation.
  • push: Push status, branch name, and remote URL.
  • get_history: List of commits with hash, author, date, and message.
  • get_status: Current branch, staged/unstaged files, and sync status.
  • create_pull_request: PR number, URL, and creation confirmation.
  • get_pull_request_info: PR metadata plus CI status for the head commit. Returns number, title, body, state, merged, user, head_branch, base_branch, head_sha (the real PR head commit — never merge_commit_sha), url, created_at, updated_at, merged_at, and merge_commit_sha under its own key. CI status for head_sha is reported as:
    • check_runs — a list of {name, status, conclusion, details_url}.
    • check_runs_total and check_runs_truncated — GitHub’s reported Check-run count and whether the bounded check_runs list is incomplete or disagrees with that count.
    • combined_status — {state, total_count, truncated, statuses:[{context, state, target_url}]}. state is GitHub’s commit-status rollup, which covers commit statuses only. total_count is how many status contexts GitHub reports, and truncated is true when the observed count disagrees with that total or the bounded walk cannot prove completeness — so a partial list is never mistaken for a complete one. (GitHub defaults to 30 statuses per page and permits up to 100; Genesis requests the maximum and continues the paginated feed.)
    • ci_summary — the derived rollup across both sources: {state, check_runs_total, check_runs_failed, check_runs_pending, check_runs_truncated, statuses_total, statuses_failed, statuses_pending, statuses_truncated, truncated}. state is failure when any check run or current status did not pass, pending when nothing failed but a signal is unfinished, incomplete, or semantically unknown, success when every known signal finished and passed and both sources are complete, and no_checks when neither source reported anything. Prefer ci_summary.state over combined_status.state for “did CI pass?”: GitHub does not fold check runs into the commit-status rollup, so combined_status.state can read success while GitHub Actions is still running.
    A failure to read one CI feed degrades gracefully rather than failing the call or discarding the other feed: only the failed source’s fields are set to null, the successful peer remains available, and ci_summary is null because the aggregate is incomplete. check_runs_error or commit_statuses_error carries the source-specific reason, and the rest of the PR metadata is still returned. On a non-rate-limited 403 the message names the grant to add, and which grant depends on the connection: a GitHub App connection is told to add Checks: read or Commit statuses: read to the installation, while a PAT or User OAuth connection is told which token scope it needs. Rate-limited and other failures report a generic read-failure message. See Connections — Permissions for reading CI results.
  • list_remote_repos: Accessible personal and organization repositories plus summary. Each repo includes both private and visibility, and summary includes total_accessible_repos, personal_repos_count, organizations_count, and visibility_breakdown.
  • check_remote_repo_exists: Successful responses include repository metadata with both private and visibility.
  • create_remote_repo: Successful responses include created repository metadata with private, visibility, default_branch, url, ssh_url, and web_url.
  • READ_FILE: Direct branch reads return content, text, text_is_lossy, sha, size, encoding, ref, path, and source. Missing refs or files return error_code="REMOTE_FILE_NOT_FOUND"; directory paths return error_code="PATH_IS_DIRECTORY". Rate-limited reads can return error_code="RATE_LIMITED" with retry_after_seconds.
  • file operations: Success confirmation, file paths, content previews, batch read results with per-file success or error details plus content and size for successful reads. Batch reads can also surface per-file truncated, truncation_info, continuation, encoding, file_type, total_size, returned_size, returned_lines, total_lines, start_line, end_line, start_byte, end_byte, and freshness_notice when a managed checkout has no git remote, plus top-level warnings, files_truncated, files_skipped, skipped_preview, and continuation_hint when the response is cut short. On managed GitHub repos, origin-backed file(action="read") can also return branch_name, sha, _remote_read, and _remote_read_window; when the checkout has no git remote, responses include freshness_notice and may set source to local_tree. When return_base64=true, the response includes encoding="base64".
  • Large path and archive previews: file(action="list") and file(action="find") can return files_preview, files_truncated, files_omitted_count, total_files, files_continuation_hint, note, and narrowing_hint when many paths match. file(action="unzip") can similarly preview extracted_files and download_links with fields such as extracted_files_preview, extracted_files_truncated, extracted_files_omitted_count, total_extracted_files, extracted_files_continuation_hint, download_links_preview, download_links_truncated, download_links_omitted_count, total_download_links, and download_links_continuation_hint.
  • Zero-result repo search warning: git_action(action="search"), git_action(action="grep"), file(action="search"), and file(action="fast_search") can include _branch_warning when a repo on a non-default branch returns 0 matches. The object includes current_branch, default_branch, and message, which directs you to switch to the default branch, run git_action(action="pull"), and retry the search.
  • Managed-remote search freshness: On managed GitHub repos, git_action(action="search") and git_action(action="grep") against the managed base checkout run against refreshed origin state instead of the shared local clone. Searches against a WIP worktree still use that worktree. When the checkout has no git remote, file(action="fast_search") searches the local checkout and includes freshness_notice.
  • list_repos: Repository ids by default. With details=true, each detail row includes mode, has_git_dir, has_remote, scope, owner_user_id, owner_bot_id, and undeletable, plus credentials-redacted remote_url when present, clone_source when Genesis can infer the remote platform, and path when include_paths=true.
  • Errors: Detailed error messages with resolution guidance (e.g., authentication failures, merge conflicts).

Best Practices

Commit Often

Make small, focused commits with clear messages. Easier to review, revert, and understand history.

Branch Strategy

Use feature branches for development. Keep main/master stable and deployable.

Pull Before Push

Always pull latest changes before pushing to avoid conflicts and ensure smooth integration.

Meaningful Messages

Write descriptive commit messages explaining what and why, not just what changed.

Example: Complete Data Project Workflow

Advanced Features

Bulk File Operations

Copy multiple files matching patterns:
Copy or move a repo-relative exact file path into a directory:
preserve_structure defaults to true for file(action="copy") and file(action="move"). Glob patterns preserve the path below the matched parent scope. Exact file paths use their parent directory as the matched scope, so source_patterns=["reports/monthly/summary.md"] writes archive/summary.md instead of recreating archive/reports/monthly/summary.md.
Read multiple repository files in one call:
file(action="read_multiple") accepts a recommended maximum of 20 files per call and a hard limit of 100. Total returned content is capped at 200 KB; when that limit is reached, remaining files are reported in skipped, skipped_preview, and files_skipped, and the top-level response adds continuation_hint. Large files are automatically truncated to about 20 KB. Successful reads include per-file content and size; truncated entries are marked with truncated: true and can also include truncation_info, continuation, encoding, file_type, total_size, returned_size, returned_lines, total_lines, start_line, end_line, start_byte, and end_byte. If any entry is truncated, the batch response adds a warning explaining how to continue from the correct byte or line offset, and the top-level response includes files_truncated with the count of truncated files. Use file(action="read") for binary or Excel files.
Very large list, find, and unzip responses are previewed instead of returned in full. files and extracted_files previews are trimmed to the first 50 paths, and download_links previews are trimmed to the first 20 links. Use fields such as files_preview, files_truncated, files_omitted_count, total_files, files_continuation_hint, note, and narrowing_hint to narrow list or find queries, or extracted_files_preview and download_links_preview to inspect the extracted directory.

Search Across Files

Find specific content in repository:
When git_action(action="search"), git_action(action="grep"), file(action="search"), or file(action="fast_search") returns zero matches for a repo on a non-default branch, the response can include _branch_warning with current_branch, default_branch, and message. Follow _branch_warning.message to switch to the default branch, run git_action(action="pull"), and retry the search.

Fetch Deep History

Get more commit history for analysis:

List Remote Repositories

Discover accessible GitHub repositories across your personal account and, by default, your organizations:
include_orgs is optional and defaults to true. Each repo in the response includes both private and visibility. Use visibility when reporting GitHub access levels because private=true covers both internal and private repositories. The summary object also includes visibility_breakdown, which counts repositories by visibility.

Troubleshooting

  • Verify Personal Access Token is valid and not expired
  • Check token has required scopes: repo, workflow
  • Re-store credentials with store_github_credentials
  • Pull latest changes first: git_action(action="pull")
  • Check for merge conflicts in get_status
  • Verify you have write permissions to repository
  • Verify file_path uses forward slashes (/)
  • Check path is relative without leading slash
  • Use file(action="list") to see available files
  • Switch to existing branch instead of creating
  • Use get_branch to check current branch
  • Delete old branch or use different name