create_pull_request
Generate a pull request in a repository to propose and review code changes. Specify title, description, source branch, and target branch to facilitate collaboration on AtomGit MCP Server.
Instructions
Create a new pull request in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| owner | Yes | ||
| repo | Yes |
Implementation Reference
- operations/pull.ts:54-66 (handler)Core handler function that performs the HTTP POST request to create a pull request on AtomGit API.export async function createPullRequest( owner: string, repo: string, body: { title: string; body: string; head: string; base: string; draft: boolean } ) { return atomGitRequest( `https://api.atomgit.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls`, { method: "POST", body, } ); }
- index.ts:381-387 (handler)MCP server tool call handler that parses input arguments, calls the createPullRequest implementation, and formats the response.case "create_pull_request": { const args = pull.CreatePullRequestSchema.parse(request.params.arguments); const result = await pull.createPullRequest(args.owner, args.repo, args.body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- operations/pull.ts:5-15 (schema)Zod schema defining the input parameters for the create_pull_request tool, used for validation.export const CreatePullRequestSchema = z.object({ owner: z.string(), repo: z.string(), body: z.object({ title: z.string(), // Pull request title body: z.string(), // Pull request description head: z.string(), // Source branch base: z.string(), // Target branch draft: z.boolean().default(false), // Draft status }), });
- index.ts:133-136 (registration)Tool registration in the MCP server's listTools response, specifying name, description, and input schema.name: "create_pull_request", description: "Create a new pull request in a repository", inputSchema: zodToJsonSchema(pull.CreatePullRequestSchema), },