gitGetTree
Get a tree
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/git/trees/{tree_sha} - Operation ID:
git/get-tree
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"tree_sha": {
"description": "The SHA1 value or ref (branch or tag) name of the tree.",
"required": true,
"location": "path",
"type": "string"
},
"recursive": {
"description": "Setting 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.",
"required": false,
"location": "query",
"type": "string"
}
}Response Schema
{
"title": "Git Tree",
"description": "The hierarchy between files in a Git repository.",
"type": "object",
"properties": {
"sha": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"truncated": {
"type": "boolean"
},
"tree": {
"description": "Objects specifying a tree structure",
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"mode",
"type",
"sha"
],
"properties": {
"path": {
"type": "string",
"example": "test/file.rb"
},
"mode": {
"type": "string",
"example": "040000"
},
"type": {
"type": "string",
"example": "tree"
},
"sha": {
"type": "string",
"example": "23f6827669e43831def8a7ad935069c8bd418261"
},
"size": {
"type": "integer",
"example": 12
},
"url": {
"type": "string",
"example": "https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261"
}
}
},
"example": [
{
"path": "file.rb",
"mode": "100644",
"type": "blob",
"size": 30,
"sha": "44b4fc6d56897b048c772eb4087f854f46256132",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132"
}
]
}
},
"required": [
"sha",
"tree",
"truncated"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('gitGetTree', {
# Add required parameters here
})