Skip to main content

Overview

The list_repos tool discovers all repositories that have been indexed by GitNexus. This is the essential first step when working with multiple repositories, providing metadata about each indexed repo including stats, commit info, and indexing status.
When to use: First step when multiple repos are indexed, or to discover available repos.Next step: READ gitnexus://repo/{name}/context for the repo you want to work with.

Parameters

This tool takes no parameters.

Response

Returns an array of repository objects, each containing:
name
string
required
Repository name (derived from path)
path
string
required
Absolute path to the repository on disk
indexedAt
string
required
ISO 8601 timestamp of when the repo was last indexed
lastCommit
object
Information about the most recent commit
stats
object
Repository indexing statistics

Example Usage

Basic Usage

{
  "name": "list_repos"
}

Example Response

[
  {
    "name": "my-app",
    "path": "/Users/dev/projects/my-app",
    "indexedAt": "2024-03-15T10:30:00Z",
    "lastCommit": {
      "hash": "a1b2c3d4",
      "message": "Add payment processing",
      "author": "Jane Doe",
      "date": "2024-03-15T09:00:00Z"
    },
    "stats": {
      "symbols": 918,
      "relationships": 2847,
      "processes": 45,
      "files": 127
    }
  },
  {
    "name": "api-gateway",
    "path": "/Users/dev/projects/api-gateway",
    "indexedAt": "2024-03-14T16:20:00Z",
    "stats": {
      "symbols": 342,
      "relationships": 891,
      "processes": 18,
      "files": 54
    }
  }
]

Multi-Repo Workflow

When multiple repositories are indexed, you must specify the repo parameter on other tools to target the correct repository:
// 1. Discover available repos
list_repos()

// 2. Target specific repo in subsequent calls
query({ query: "auth", repo: "my-app" })
context({ name: "validateUser", repo: "my-app" })
impact({ target: "processPayment", direction: "upstream", repo: "my-app" })

Best Practices

When working with multiple repositories, call list_repos first to understand what’s available and ensure you’re targeting the correct repo in subsequent calls.
Compare indexedAt with lastCommit.date to identify stale indexes. If the index is outdated, run npx gitnexus analyze to refresh.
Use the stats to understand repository size and complexity before diving into queries. Large symbol counts may require more focused queries.
  • query - Search for execution flows after identifying the target repo
  • context - Get detailed symbol information within a specific repo
  • gitnexus://repos - Alternative way to list repos via MCP resources
  • gitnexus://repo/{name}/context - Detailed repo context including staleness warnings

Build docs developers (and LLMs) love