Skip to main content
Glama

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
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
nameYesThe name of the project
bodyNoThe description of the project

Implementation Reference

  • 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);
    }
  • 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"),
    });
  • 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"),
    });
  • 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),
    },
  • 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) }],
      };
    }

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/MissionSquad/mcp-github'

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