Skip to main content
Glama

push_files

Push multiple files to a GitLab project in a single commit, enabling batch file updates with specified paths, content, and commit message.

Instructions

Push multiple files to a GitLab project in a single commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or URL-encoded path
branchYesBranch to push to
filesYesArray of files to push
commit_messageYesCommit message

Implementation Reference

  • The request handler for "push_files" in src/server.ts. It parses the request arguments and calls the API function "createCommit".
    case "push_files": {
      const args = PushFilesSchema.parse(request.params.arguments);
      const result = await api.createCommit(
        args.project_id,
        args.commit_message,
        args.branch,
        args.files.map((f) => ({ path: f.file_path, content: f.content }))
      );
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • The implementation of the API function `createCommit` that actually interacts with GitLab to push the files.
    export async function createCommit(
      projectId: string,
      message: string,
      branch: string,
      actions: FileOperation[]
    ): Promise<GitLabCommit> {
      if (!projectId?.trim()) {
        throw new Error("Project ID is required");
      }
      if (!message?.trim()) {
        throw new Error("Commit message is required");
      }
      if (!branch?.trim()) {
        throw new Error("Branch is required");
      }
      if (!actions || actions.length === 0) {
        throw new Error("At least one file action is required");
      }
    
      const endpoint = `/projects/${encodeProjectId(projectId)}/repository/commits`;
    
      const commit = await gitlabPost<GitLabCommit>(endpoint, {
        branch,
        commit_message: message,
        actions: actions.map((action) => ({
          action: "create",
          file_path: action.path,
          content: action.content
        }))
      });
    
      return GitLabCommitSchema.parse(commit);
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic operation. It lacks details on permissions needed, whether it overwrites existing files, error handling, rate limits, or commit behavior (e.g., atomicity). This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence with no wasted words. It front-loads the core action and scope appropriately, making it easy to parse.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficient. It misses critical behavioral details (e.g., side effects, error responses) and doesn't compensate for the lack of structured metadata, leaving gaps in understanding how the tool operates.

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 parameters are well-documented in the schema. The description adds no additional semantic context beyond implying batch processing, which aligns with the 'files' array parameter but doesn't elaborate on format or constraints.

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

Purpose4/5

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

The description clearly states the action ('push multiple files') and target ('to a GitLab project in a single commit'), making the purpose evident. It distinguishes from siblings like 'create_or_update_file' by emphasizing batch operations, though it doesn't explicitly name alternatives.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'create_or_update_file' or 'create_branch'. The description implies batch file creation but doesn't specify prerequisites, error conditions, or contextual constraints.

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/TheRealChrisThomas/gitlab-mcp-server'

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