Skip to main content
Glama
PhialsBasement

GitHub MCP Server Plus

push_files_content

Push multiple files with direct content to a GitHub repository in a single commit, enabling batch file updates without local file management.

Instructions

Push multiple files with direct content to a GitHub repository in a single commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
branchYesBranch to push to (e.g., 'main' or 'master')
filesYesArray of files to push with their content
messageYesCommit message

Implementation Reference

  • Core handler function that implements the logic to push multiple files' content to GitHub repo by creating a Git tree, commit, and updating the branch reference.
    export async function pushFilesContent(
      owner: string,
      repo: string,
      branch: string,
      files: FileContent[],
      message: string
    ) {
      const refResponse = await githubRequest(
        `https://api.github.com/repos/${owner}/${repo}/git/refs/heads/${branch}`
      );
    
      const ref = GitHubReferenceSchema.parse(refResponse);
      const commitSha = ref.object.sha;
    
      const tree = await createTree(owner, repo, files, commitSha);
      const commit = await createCommit(owner, repo, message, tree.sha, [commitSha]);
      return await updateReference(owner, repo, `heads/${branch}`, commit.sha);
    }
  • Zod input schema defining parameters for the push_files_content tool: owner, repo, branch, files array, and commit message.
    export const PushFilesContentSchema = z.object({
      owner: z.string().describe("Repository owner (username or organization)"),
      repo: z.string().describe("Repository name"),
      branch: z.string().describe("Branch to push to (e.g., 'main' or 'master')"),
      files: z.array(FileContentSchema).describe("Array of files to push with their content"),
      message: z.string().describe("Commit message"),
    });
  • index.ts:88-92 (registration)
    Registration of the push_files_content tool in the MCP server tools list, specifying name, description, and schema.
    {
      name: "push_files_content",
      description: "Push multiple files with direct content to a GitHub repository in a single commit",
      inputSchema: zodToJsonSchema(files.PushFilesContentSchema),
    },
  • MCP request handler case for push_files_content: parses arguments, calls the implementation function, and formats response.
    case "push_files_content": {
      const args = files.PushFilesContentSchema.parse(request.params.arguments);
      const result = await files.pushFilesContent(
        args.owner,
        args.repo,
        args.branch,
        args.files,
        args.message
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool performs a write operation ('push') but doesn't mention critical behavioral aspects: whether it overwrites existing files, requires authentication/permissions, handles errors, or has rate limits. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves beyond the basic action.

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 a single, well-structured sentence that efficiently communicates the core functionality without unnecessary words. It's front-loaded with the main action and includes all essential elements: what (push files with content), where (GitHub repository), and how (single commit). Every word earns its place.

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

Completeness3/5

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

For a mutation tool with 5 parameters, 100% schema coverage, but no annotations or output schema, the description is minimally complete. It covers the basic purpose and scope but lacks behavioral details (overwrite behavior, error handling, authentication needs) and output information. Given the complexity of a GitHub file-push operation, more context would be helpful, though the schema handles parameter documentation adequately.

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

Parameters3/5

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

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds minimal value beyond the schema by implying 'multiple files' (matching the 'files' array parameter) and 'single commit' (related to the 'message' parameter), but doesn't provide additional semantic context about parameter usage, constraints, or relationships. This meets the baseline for high schema coverage.

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 the specific action ('push multiple files with direct content'), the target resource ('to a GitHub repository'), and the operational scope ('in a single commit'). It distinguishes itself from sibling tools like 'push_files_from_path' by specifying 'direct content' rather than file paths, and from 'create_or_update_file' by handling multiple files in one commit.

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'multiple files with direct content' and 'single commit', suggesting it's for batch updates rather than individual file operations. However, it doesn't explicitly state when to use this tool versus alternatives like 'push_files_from_path' (which likely uses file system paths) or 'create_or_update_file' (which handles single files). The context is clear but lacks explicit comparison guidance.

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

Install Server

Other Tools

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/PhialsBasement/mcp-github-server-plus'

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