Home / Servers / GitHub API / git_create_tree

Create a tree

An MCP tool from the GitHub API server, hosted on mcp.hjlabs.in.

Create a tree The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and… [POST /repos/{owner}/{repo}/git/trees]

Name on the gateway: github_api__git_create_tree · may change things.

Parameters

NameTypeDescription
owner requiredstringThe account owner of the repository. The name is not case…
repo requiredstringThe name of the repository without the .git extension. The…
tree requiredarrayObjects (of path, mode, type, and sha) specifying a tree structure.
base_treestringThe SHA1 of an existing Git tree object which will be used as the base for the…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "github_api__git_create_tree",
  "arguments": {
    "owner": "…",
    "repo": "…",
    "tree": []
  }
}

Or connect the GitHub API server directly, which lists 1,221 tools including this one:

Run in your terminal
claude mcp add --transport http hj-github-api https://mcp.hjlabs.in/mcp/github-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the create a tree tool with owner set to ….

More from GitHub API