create_pull_request
Create a new pull request in an AtomGit repository to propose code changes for review and merging into the main branch.
Instructions
Create a new pull request in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| body | Yes |
Implementation Reference
- operations/pull.ts:54-66 (handler)Core handler function that executes the logic to create a pull request by making a POST request to the 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, } ); }
- operations/pull.ts:5-15 (schema)Zod schema defining the input structure for the create_pull_request tool.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:132-136 (registration)Tool registration in the list of available tools, including name, description, and input schema reference.{ name: "create_pull_request", description: "Create a new pull request in a repository", inputSchema: zodToJsonSchema(pull.CreatePullRequestSchema), },
- index.ts:381-387 (handler)Dispatcher handler in the CallToolRequest switch statement that validates input and invokes the core createPullRequest function.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) }], }; }