Skip to main content
Glama

fork_repository

Create a copy of a Gitee repository by specifying the owner and repository paths. Optionally, fork into an organization for collaborative development.

Instructions

Fork Gitee 仓库

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationNoOrganization path, defaults to personal account if not provided
ownerYesRepository owner path (enterprise, organization, or personal path)
repoYesRepository path

Implementation Reference

  • Implements the fork_repository tool by validating inputs, constructing the Gitee API URL `/repos/{owner}/{repo}/forks`, sending a POST request with optional organization, and parsing the response as a repository object.
    export async function forkRepository(
      owner: string,
      repo: string,
      organization?: string
    ) {
      owner = validateOwnerName(owner);
      repo = validateRepositoryName(repo);
    
      const url = `/repos/${owner}/${repo}/forks`;
      const body: Record<string, string> = {};
    
      if (organization) {
        body.organization = validateOwnerName(organization);
      }
    
      const response = await giteeRequest(url, "POST", body);
    
      return GiteeRepositorySchema.parse(response);
    }
  • Zod schema defining the input parameters for the fork_repository tool: owner (required string), repo (required string), organization (optional string).
    export const ForkRepositorySchema = z.object({
      // 仓库所属空间地址 (企业、组织或个人的地址 path)
      owner: z.string().describe("Repository owner path (enterprise, organization, or personal path)"),
      // 仓库路径 (path)
      repo: z.string().describe("Repository path"),
      // 组织空间地址,不传默认为个人
      organization: z.string().optional().describe("Organization path, defaults to personal account if not provided"),
    });
  • index.ts:51-59 (registration)
    Registers the 'fork_repository' tool on the MCP server, referencing the schema and delegating to the forkRepository handler from repoOperations.
    server.registerTool({
      name: "fork_repository",
      description: "Fork Gitee 仓库",
      schema: repoOperations.ForkRepositorySchema,
      handler: async (params: any) => {
        const { owner, repo, organization } = params;
        return await repoOperations.forkRepository(owner, repo, organization);
      },
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('fork') but doesn't describe what happens during forking (e.g., creates a copy under the user's account, inherits content), potential side effects, authentication requirements, rate limits, or error conditions. This leaves significant gaps 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 extremely concise ('Fork Gitee 仓库') with no wasted words, making it easy to parse. It's front-loaded with the core action and resource. Every word earns its place, though this conciseness comes at the cost of completeness.

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?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain the fork operation's behavior, what is returned (e.g., new repository details), error handling, or usage context. For a tool that modifies data, more detail is needed to guide the agent effectively.

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%, with clear descriptions for all three parameters (owner, repo, organization). The description doesn't add any parameter semantics beyond what's in the schema, such as explaining the relationship between owner and organization or providing examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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 'Fork Gitee 仓库' clearly states the action (fork) and resource (Gitee repository) in a concise manner. It distinguishes from siblings like 'create_repository' which creates a new repository rather than forking an existing one. However, it doesn't specify what 'fork' entails (creating a copy under user's account).

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. The description doesn't mention prerequisites (e.g., needing access to the source repository), when forking is appropriate versus cloning or creating new repositories, or any limitations. Sibling tools include related operations but no comparison is offered.

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