Skip to main content
Glama

push_files

Push multiple files to a GitLab project in one commit using branch, commit message, and file content. Simplify file updates with batch processing.

Instructions

Push multiple files to a GitLab project in a single commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNo
commit_messageNo
filesNo
project_idNo

Implementation Reference

  • Handler for the 'push_files' tool. Parses input arguments using PushFilesSchema, iterates over each file, and calls gitlabApi.createOrUpdateFile to push each file individually (noted as workaround for batch commit). Returns array of results.
    case "push_files": {
      const args = PushFilesSchema.parse(request.params.arguments);
    
      // Use individual file creation for each file instead of batch commit
      const results = [];
      for (const file of args.files) {
        try {
          const result = await gitlabApi.createOrUpdateFile(
            args.project_id,
            file.path,
            file.content,
            args.commit_message,
            args.branch
          );
          results.push(result);
        } catch (error) {
          console.error(`Error creating/updating file ${file.path}:`, error);
          throw error;
        }
      }
    
      return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
    }
  • Zod schema definition for 'push_files' tool input: requires project_id, array of files (path/content), commit_message, branch.
    export const PushFilesSchema = z.object({
      project_id: z.string(),
      files: z.array(FileOperationSchema),
      commit_message: z.string(),
      branch: z.string()
    });
  • src/index.ts:132-137 (registration)
    Registration of the 'push_files' tool in the ALL_TOOLS array, including name, description, input schema, and readOnly flag. Used by ListToolsRequestSchema handler.
    {
      name: "push_files",
      description: "Push multiple files to a GitLab project in a single commit",
      inputSchema: createJsonSchema(PushFilesSchema),
      readOnly: false
    },
  • Supporting schema for file operations used in PushFilesSchema (files array). Defines path and content for each file.
    export const FileOperationSchema = z.object({
      path: z.string(),
      content: z.string()
    });
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 fails to disclose critical behavioral traits such as required permissions, whether it overwrites existing files, error handling for invalid paths, or commit creation details beyond the single-commit scope.

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 zero waste—front-loaded and directly states the tool's core function without unnecessary elaboration.

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 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on behavior, error cases, return values, and parameter semantics, making it incomplete for safe and effective use.

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 0%, but the description adds minimal context by implying parameters like files, branch, and commit_message. However, it doesn't explain parameter meanings (e.g., project_id format, file content encoding) or constraints, leaving significant gaps.

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'), target resource ('to a GitLab project'), and scope ('in a single commit'), distinguishing it from siblings like create_or_update_file (which handles single files) or upload_wiki_attachments (which targets wiki pages).

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 for single-file updates or other GitLab operations. The description lacks context about prerequisites (e.g., branch existence, permissions) or exclusions.

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

Related 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/yoda-digital/mcp-gitlab-server'

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