Skip to main content
Glama

githubViewRepoStructure

Read-onlyIdempotent

View directory tree of any GitHub repository to discover its structure and find entry points. Drill into subdirectories for detailed layout.

Instructions

Display GitHub repo structure [EXTERNAL: GitHub API]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesResearch queries for githubViewRepoStructure (1-3 queries per call for optimal resource management). Review schema before use for optimal results
responseCharOffsetNoCharacter offset for top-level bulk response pagination across results[]. Use when a multi-query response was auto-paginated.
responseCharLengthNoCharacter budget for top-level bulk response pagination across results[]. Overrides the shared default for this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYesArray of results, one per input query, discriminated by status
responsePaginationNoPagination metadata for top-level bulk response pagination across results[]

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed22 schema fields changedv9.1.1
    • removedInput schema / properties / queries / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / queries / items / properties / branch / description
      Added value: +"Branch/tag/SHA (optional, defaults to default branch). Use main/master or get from githubSearchRepositories"
    • addedInput schema / properties / queries / items / properties / charLength
      Added value: +{
      +  "description": "Character budget for output pagination after entry pagination has been applied.",
      +  "maximum": 50000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / queries / items / properties / charOffset
      Added value: +{
      +  "description": "Character offset for output pagination after entry pagination has been applied.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / queries / items / properties / depth / description
      Added value: +"1 (current) or 2 (subdirs). Default: 1"
    • changedInput schema / properties / queries / items / properties / depth / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / queries / items / properties / entriesPerPage / description
      Added value: +"Entries per page (default: 50, max: 200)"
    • changedInput schema / properties / queries / items / properties / entriesPerPage / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / queries / items / properties / entryPageNumber / description
      Added value: +"Page number (1-based). Default: 1"
    • addedInput schema / properties / queries / items / properties / entryPageNumber / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / queries / items / properties / entryPageNumber / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / queries / items / properties / id
      Added value: +{
      +  "description": "Stable query identifier used to match each result to its input query. Required for every query. Use a short meaningful string like \"react_hooks_search\" or \"router_prs\".",
      +  "maxLength": 120,
      +  "minLength": 1,
      +  "pattern": "^[A-Za-z0-9._:-]+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / queries / items / properties / mainResearchGoal / description
      Added value: +"Main research objective (multiple queries can share the same main goal for semantic grouping and session tracking)"
    • addedInput schema / properties / queries / items / properties / owner / description
      Added value: +"Repo owner"
    • addedInput schema / properties / queries / items / properties / path / description
      Added value: +"Directory path (empty for root)"
    • addedInput schema / properties / queries / items / properties / reasoning / description
      Added value: +"Why this query helps achieve the goal"
    • addedInput schema / properties / queries / items / properties / repo / description
      Added value: +"Repo name"
    • addedInput schema / properties / queries / items / properties / researchGoal / description
      Added value: +"Specific information this query seeks"
    • changedInput schema / properties / queries / items / required
      Previous value: -[
      -  "mainResearchGoal",
      -  "researchGoal",
      -  "reasoning",
      -  "owner",
      -  "repo",
      -  "branch"
      -]New value: +[
      +  "id",
      +  "mainResearchGoal",
      +  "researchGoal",
      +  "reasoning",
      +  "owner",
      +  "repo"
      +]
    • addedInput schema / properties / responseCharLength
      Added value: +{
      +  "description": "Character budget for top-level bulk response pagination across results[]. Overrides the shared default for this call.",
      +  "maximum": 50000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / responseCharOffset
      Added value: +{
      +  "description": "Character offset for top-level bulk response pagination across results[]. Use when a multi-query response was auto-paginated.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "responsePagination": {
      +      "additionalProperties": false,
      +      "description": "Pagination metadata for top-level bulk response pagination across results[]",
      +      "properties": {
      +        "charLength": {
      +          "description": "Character length of the current page",
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "charOffset": {
      +          "description": "Character offset of the current page",
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "currentPage": {
      +          "description": "Current page number (1-indexed)",
      +          "exclusiveMinimum": 0,
      +          "maximum": 9007199254740991,
      +          "type": "integer"
      +        },
      +        "hasMore": {
      +          "description": "Whether more pages are available after the current page",
      +          "type": "boolean"
      +        },
      +        "totalChars": {
      +          "description": "Total number of characters in the full output",
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "totalPages": {
      +          "description": "Total number of pages available",
      +          "exclusiveMinimum": 0,
      +          "maximum": 9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "currentPage",
      +        "totalPages",
      +        "hasMore",
      +        "charOffset",
      +        "charLength",
      +        "totalChars"
      +      ],
      +      "type": "object"
      +    },
      +    "results": {
      +      "description": "Array of results, one per input query, discriminated by status",
      +      "items": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "data": {
      +                "additionalProperties": false,
      +                "description": "The tool-specific result data",
      +                "properties": {
      +                  "branchFallback": {
      +                    "additionalProperties": false,
      +                    "description": "Branch fallback details when the requested branch was not used",
      +                    "properties": {
      +                      "actualBranch": {
      +                        "description": "Branch actually used in the result",
      +                        "type": "string"
      +                      },
      +                      "defaultBranch": {
      +                        "description": "Repository default branch when known",
      +                        "type": "string"
      +                      },
      +                      "requestedBranch": {
      +                        "description": "Branch requested in the query",
      +                        "type": "string"
      +                      },
      +                      "warning": {
      +                        "description": "Human-readable explanation of the branch fallback",
      +                        "type": "string"
      +                      }
      +                    },
      +                    "required": [
      +                      "requestedBranch",
      +                      "actualBranch",
      +                      "warning"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "hints": {
      +                    "description": "Contextual hints and suggestions for next steps or better queries",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "outputPagination": {
      +                    "additionalProperties": false,
      +                    "description": "Payload pagination metadata when the structure payload was size-paginated",
      +                    "properties": {
      +                      "charLength": {
      +                        "description": "Character length of the current page",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "charOffset": {
      +                        "description": "Character offset of the current page",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "currentPage": {
      +                        "description": "Current page number (1-indexed)",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      },
      +                      "hasMore": {
      +                        "description": "Whether more pages are available after the current page",
      +                        "type": "boolean"
      +                      },
      +                      "totalChars": {
      +                        "description": "Total number of characters in the full output",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "totalPages": {
      +                        "description": "Total number of pages available",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      }
      +                    },
      +                    "required": [
      +                      "currentPage",
      +                      "totalPages",
      +                      "hasMore",
      +                      "charOffset",
      +                      "charLength",
      +                      "totalChars"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "pagination": {
      +                    "additionalProperties": false,
      +                    "description": "Pagination info for large directory listings",
      +                    "properties": {
      +                      "currentPage": {
      +                        "description": "Current page number (1-indexed)",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      },
      +                      "entriesPerPage": {
      +                        "description": "Directory entries returned per page",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      },
      +                      "hasMore": {
      +                        "description": "Whether more pages are available after the current page",
      +                        "type": "boolean"
      +                      },
      +                      "totalEntries": {
      +                        "description": "Total matching entries across all pages",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "totalPages": {
      +                        "description": "Total number of pages available",
      +                        "exclusiveMinimum": 0,
      +                        "maximum": 9007199254740991,
      +                        "type": "integer"
      +                      }
      +                    },
      +                    "required": [
      +                      "currentPage",
      +                      "totalPages",
      +                      "hasMore",
      +                      "entriesPerPage",
      +                      "totalEntries"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "resolvedBranch": {
      +                    "description": "Resolved branch used when the input query omitted a branch",
      +                    "type": "string"
      +                  },
      +                  "structure": {
      +                    "additionalProperties": {
      +                      "additionalProperties": false,
      +                      "properties": {
      +                        "files": {
      +                          "description": "File names in the directory",
      +                          "items": {
      +                            "type": "string"
      +                          },
      +                          "type": "array"
      +                        },
      +                        "folders": {
      +                          "description": "Subdirectory names in the directory",
      +                          "items": {
      +                            "type": "string"
      +                          },
      +                          "type": "array"
      +                        }
      +                      },
      +                      "required": [
      +                        "files",
      +                        "folders"
      +                      ],
      +                      "type": "object"
      +                    },
      +                    "description": "Directory structure grouped by relative path",
      +                    "propertyNames": {
      +                      "type": "string"
      +                    },
      +                    "type": "object"
      +                  },
      +                  "summary": {
      +                    "additionalProperties": false,
      +                    "description": "Summary statistics for the returned repository structure",
      +                    "properties": {
      +                      "totalFiles": {
      +                        "description": "Total files included in the structure result",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "totalFolders": {
      +                        "description": "Total folders included in the structure result",
      +                        "maximum": 9007199254740991,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "truncated": {
      +                        "description": "Whether the provider truncated the structure result",
      +                        "type": "boolean"
      +                      }
      +                    },
      +                    "required": [
      +                      "totalFiles",
      +                      "totalFolders",
      +                      "truncated"
      +                    ],
      +                    "type": "object"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "id": {
      +                "description": "Stable query identifier matching the input query id",
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "status": {
      +                "const": "hasResults",
      +                "description": "Indicates the query returned results successfully",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "status",
      +              "data"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "data": {
      +                "additionalProperties": {},
      +                "description": "Empty result metadata (may contain hints or paging details)",
      +                "properties": {},
      +                "type": "object"
      +              },
      +              "id": {
      +                "description": "Stable query identifier matching the input query id",
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "status": {
      +                "const": "empty",
      +                "description": "Indicates the query returned no matching results",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "status",
      +              "data"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "data": {
      +                "additionalProperties": false,
      +                "description": "Error details including message, type, and recovery hints",
      +                "properties": {
      +                  "cwd": {
      +                    "description": "Working directory relevant to the error",
      +                    "type": "string"
      +                  },
      +                  "error": {
      +                    "anyOf": [
      +                      {
      +                        "type": "string"
      +                      },
      +                      {
      +                        "additionalProperties": false,
      +                        "properties": {
      +                          "error": {
      +                            "description": "GitHub API error message",
      +                            "type": "string"
      +                          },
      +                          "hints": {
      +                            "description": "Provider-specific hints",
      +                            "items": {
      +                              "type": "string"
      +                            },
      +                            "type": "array"
      +                          },
      +                          "rateLimitRemaining": {
      +                            "description": "Remaining API requests in the current rate limit window",
      +                            "type": "number"
      +                          },
      +                          "rateLimitReset": {
      +                            "description": "Rate limit reset time in milliseconds since epoch",
      +                            "type": "number"
      +                          },
      +                          "retryAfter": {
      +                            "description": "Retry-after delay in seconds",
      +                            "type": "number"
      +                          },
      +                          "scopesSuggestion": {
      +                            "description": "Suggested scopes needed to resolve the error",
      +                            "type": "string"
      +                          },
      +                          "status": {
      +                            "description": "HTTP status code",
      +                            "maximum": 9007199254740991,
      +                            "minimum": -9007199254740991,
      +                            "type": "integer"
      +                          },
      +                          "type": {
      +                            "description": "GitHub API error category",
      +                            "enum": [
      +                              "http",
      +                              "graphql",
      +                              "network",
      +                              "unknown"
      +                            ],
      +                            "type": "string"
      +                          }
      +                        },
      +                        "required": [
      +                          "error",
      +                          "type"
      +                        ],
      +                        "type": "object"
      +                      }
      +                    ],
      +                    "description": "Error message or API error object"
      +                  },
      +                  "errorCode": {
      +                    "description": "Tool error code",
      +                    "type": "string"
      +                  },
      +                  "errorType": {
      +                    "description": "Tool-specific error type (e.g. symbol_not_found, size_limit)",
      +                    "type": "string"
      +                  },
      +                  "hints": {
      +                    "description": "Recovery hints",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "resolvedPath": {
      +                    "description": "Resolved filesystem path involved in the error",
      +                    "type": "string"
      +                  },
      +                  "searchRadius": {
      +                    "description": "LSP search radius when symbol not found",
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "error"
      +                ],
      +                "type": "object"
      +              },
      +              "id": {
      +                "description": "Stable query identifier matching the input query id",
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "status": {
      +                "const": "error",
      +                "description": "Indicates the query encountered an error",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "status",
      +              "data"
      +            ],
      +            "type": "object"
      +          }
      +        ]
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "results"
      +  ],
      +  "type": "object"
      +}
  2. Changed9 schema fields changedv1.0.0
    • removedInput schema / properties / branch
      Removed value: -{
      -  "description": "Branch name. Default branch varies between repositories. Tool will automatically try default branch if specified branch is not found, but it is more efficient to verify the correct branch first.",
      -  "maxLength": 255,
      -  "minLength": 1,
      -  "pattern": "^[^\\s]+$",
      -  "type": "string"
      -}
    • removedInput schema / properties / depth
      Removed value: -{
      -  "default": 2,
      -  "description": "Depth of directory structure to explore. Default is 2. Maximum is 4 to prevent excessive API calls and maintain performance.",
      -  "maximum": 4,
      -  "minimum": 1,
      -  "type": "integer"
      -}
    • removedInput schema / properties / includeIgnored
      Removed value: -{
      -  "default": false,
      -  "description": "If true, shows all files and folders including configuration files, lock files, hidden directories, etc. Default is false to show only relevant code files and directories. for optimization",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / owner
      Removed value: -{
      -  "description": "Repository owner/organization name (e.g., \"facebook\", \"microsoft\"). Do NOT include repository name.",
      -  "maxLength": 100,
      -  "minLength": 1,
      -  "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$",
      -  "type": "string"
      -}
    • removedInput schema / properties / path
      Removed value: -{
      -  "default": "",
      -  "description": "Directory path within repository. Start with empty path to see actual repository structure first. Do not assume repository structure or nested paths exist. Do not start with slash. Verify path exists before using specific directories.",
      -  "type": "string"
      -}
    • addedInput schema / properties / queries
      Added value: +{
      +  "description": "Research queries for githubViewRepoStructure (1-3 queries per call for optimal resource management). Review schema before use for optimal results",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "branch": {
      +        "maxLength": 255,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "depth": {
      +        "default": 1,
      +        "maximum": 2,
      +        "minimum": 1,
      +        "type": "number"
      +      },
      +      "entriesPerPage": {
      +        "default": 50,
      +        "maximum": 200,
      +        "minimum": 1,
      +        "type": "number"
      +      },
      +      "entryPageNumber": {
      +        "default": 1,
      +        "minimum": 1,
      +        "type": "number"
      +      },
      +      "mainResearchGoal": {
      +        "type": "string"
      +      },
      +      "owner": {
      +        "maxLength": 200,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "path": {
      +        "default": "",
      +        "type": "string"
      +      },
      +      "reasoning": {
      +        "type": "string"
      +      },
      +      "repo": {
      +        "maxLength": 150,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "researchGoal": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "mainResearchGoal",
      +      "researchGoal",
      +      "reasoning",
      +      "owner",
      +      "repo",
      +      "branch"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 3,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / properties / repo
      Removed value: -{
      -  "description": "Repository name under a organization. ",
      -  "maxLength": 100,
      -  "minLength": 1,
      -  "pattern": "^[a-zA-Z0-9._-]+$",
      -  "type": "string"
      -}
    • removedInput schema / properties / showMedia
      Removed value: -{
      -  "default": false,
      -  "description": "If true, shows media files (images, videos, audio, documents). Default is false to hide media files and focus on code structure.",
      -  "type": "boolean"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "owner",
      -  "repo",
      -  "branch"
      -]New value: +[
      +  "queries"
      +]
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description adds crucial behavioral details in '<gotchas>': depth=2 slowdown, auto-filtering of noisy dirs (e.g., .git, node_modules), maximum 200 items, and the need to check summary.truncated. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (<when>, <fromTool>, <toTool>, <gotchas>, <examples>) that are front-loaded and efficient. Every sentence provides actionable information with no redundancy, making it easy for an agent to parse and apply.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity, output schema existence, and full schema coverage, the description covers all necessary aspects: use cases, workflow, gotchas, examples, and tool interactions. It leaves no critical gaps for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value through examples (e.g., path='', depth=1; path='src', depth=2) and gotchas that clarify parameter usage (starting from root, depth constraints). While not exhaustive, it enhances understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Display GitHub repo structure' and positions it as an entry point for understanding layout and discovering paths. It explicitly distinguishes from sibling tools like githubSearchCode and githubGetFileContent via the 'toTool' section, ensuring no ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit <when> section describing use cases (Understand layout, Discover paths, Entry point) and a workflow (Root depth=1, then Drill path+depth=2). Also includes 'fromTool' and 'toTool' sections that guide the agent on tool chaining, offering clear when-to-use and when-to-alternate guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bgauryy/octocode'

If you have feedback or need assistance with the MCP directory API, please join our Discord server