create_project
Create a new project for a GitHub repository by specifying owner, repository name, and project details to organize development tasks.
Instructions
Create a new project for a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name | |
| name | Yes | The name of the project | |
| body | No | The description of the project |
Implementation Reference
- src/operations/projects.ts:129-151 (handler)The main handler function that executes the create_project tool logic by sending a POST request to GitHub API to create a project in the specified repository.export async function createProject( github_pat: string, owner: string, repo: string, name: string, body?: string ): Promise<z.infer<typeof ProjectSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/projects`, { method: "POST", body: { name, body, }, headers: { "Accept": "application/vnd.github.inertia-preview+json", }, } ); return ProjectSchema.parse(response); }
- src/operations/projects.ts:61-66 (schema)Input schema definition for the create_project tool (public version without github_pat).export const CreateProjectSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), name: z.string().describe("The name of the project"), body: z.string().optional().describe("The description of the project"), });
- src/operations/projects.ts:68-70 (schema)Extended input schema including the required github_pat for internal parsing.export const _CreateProjectSchema = CreateProjectSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/operations/projects.ts:6-20 (schema)Output schema for parsing the GitHub project response.export const ProjectSchema = z.object({ id: z.number(), node_id: z.string(), url: z.string(), html_url: z.string(), columns_url: z.string(), owner_url: z.string(), name: z.string(), body: z.string().nullable(), number: z.number(), state: z.string(), creator: GitHubIssueAssigneeSchema, created_at: z.string(), updated_at: z.string(), });
- src/index.ts:255-258 (registration)Tool registration in the listTools response, defining name, description, and input schema.name: "create_project", description: "Create a new project for a repository", inputSchema: zodToJsonSchema(projects.CreateProjectSchema), },
- src/index.ts:694-701 (handler)Dispatch handler in the main CallToolRequest handler that parses arguments and calls the projects.createProject function.case "create_project": { const args = projects._CreateProjectSchema.parse(params.arguments); const { github_pat, owner, repo, name, body } = args; const result = await projects.createProject(github_pat, owner, repo, name, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }