Skip to main content
Glama

create_or_update_file

Create or update files in Gitee repositories by specifying the repository path, file content, and commit message. Manage branches and file SHA for precise file operations.

Instructions

在 Gitee 仓库中创建或更新文件

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoBranch name, defaults to the repository's default branch
contentYesFile content
messageYesCommit message
ownerYesRepository owner path (enterprise, organization, or personal path)
pathYesFile path
repoYesRepository path
shaNoFile SHA, required when updating an existing file

Implementation Reference

  • index.ts:110-126 (registration)
    Registration of the 'create_or_update_file' MCP tool, including name, description, schema from fileOperations, and a thin handler that delegates to fileOperations.createOrUpdateFile
    server.registerTool({
      name: "create_or_update_file",
      description: "在 Gitee 仓库中创建或更新文件",
      schema: fileOperations.CreateOrUpdateFileSchema,
      handler: async (params: any) => {
        const { owner, repo, path, content, message, branch, sha } = params;
        return await fileOperations.createOrUpdateFile(
          owner,
          repo,
          path,
          content,
          message,
          branch,
          sha
        );
      },
    });
  • The tool handler function which destructures input parameters and invokes the underlying fileOperations.createOrUpdateFile implementation.
    handler: async (params: any) => {
      const { owner, repo, path, content, message, branch, sha } = params;
      return await fileOperations.createOrUpdateFile(
        owner,
        repo,
        path,
        content,
        message,
        branch,
        sha
      );
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 mentions 'create or update' which implies mutation, but doesn't specify whether this requires specific permissions, what happens on conflicts, whether changes are reversible, or any rate limits. The description is minimal and lacks critical behavioral context for a mutation tool.

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 in Chinese that directly states the tool's purpose. There's no wasted language or unnecessary elaboration. It's appropriately sized for a tool with comprehensive schema documentation.

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 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens when creating versus updating, what the SHA parameter does, what the return value looks like, or error conditions. The combination of sparse description and missing structured data leaves significant gaps for an AI agent.

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%, providing good documentation for all 7 parameters. The description adds no additional parameter information beyond what's in the schema. The baseline score of 3 reflects adequate parameter documentation through the schema alone, though the description doesn't enhance understanding of parameter relationships or usage patterns.

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 ('创建或更新文件' - create or update file) and the target resource ('在 Gitee 仓库中' - in Gitee repository). It distinguishes from siblings like 'create_repository' or 'get_file_contents' by focusing on file manipulation. However, it doesn't explicitly differentiate from 'push_files' which might have overlapping functionality.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'push_files' or 'create_branch' for related operations, nor does it specify prerequisites like authentication requirements or repository access levels.

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/normal-coder/gitee-mcp-server'

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