GitHub Git Get Tree

1 credits/call
ae_github_git_get_tree

View the folder and file structure of a specific point in your GitHub repository’s history, using its SHA hash.

Productivity
1 credits/call

Pricing

1 credits/call
ConditionCharge
Each call1 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
repostringYesThe name of the repository without the `.git` extension. The name is not case sensitive.—
ownerstringYesThe account owner of the repository. The name is not case sensitive.—
tree_shastringYesThe SHA1 value or ref (branch or tag) name of the tree.—
recursivestringNoSetting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees.—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_github_git_get_tree' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "owner": "alexgreensh",
    "recursive": "1",
    "repo": "token-optimizer",
    "tree_sha": "main"
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "sha": "077bf10dcf442762c85f026e41ec8e0817e3e5e3",
  "tree": [
    {
      "mode": "040000",
      "path": ".agents",
      "sha": "e0fc169c8dcfe5219766e294749da70a46068f3f",
      "type": "tree",
      "url": "https://api.github.com/repos/alexgreensh/token-optimizer/git/trees/e0fc169c8dcfe5219766e294749da70a46068f3f"
    }
  ],
  "url": "https://api.github.com/repos/alexgreensh/token-optimizer/git/trees/077bf10dcf442762c85f026e41ec8e0817e3e5e3"
}

This example shows part of the response. Copied content is valid JSON.