Skip to main content
Glama

delete_project

Remove GitHub projects to clean up your workspace and manage repositories efficiently. This tool deletes projects using their unique project ID.

Instructions

Delete a GitHub project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes

Implementation Reference

  • Core handler method in ProjectManagementService that executes the delete_project tool logic. Validates input implicitly via schema, calls repository delete, and formats success response.
    async deleteProject(data: {
      projectId: string;
    }): Promise<{ success: boolean; message: string }> {
      try {
        await this.projectRepo.delete(data.projectId);
        return {
          success: true,
          message: `Project ${data.projectId} has been deleted`,
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Repository implementation that performs the actual GitHub GraphQL deleteProjectV2 mutation to delete the project.
    async delete(id: ProjectId): Promise<void> {
      const mutation = `
        mutation($input: DeleteProjectV2Input!) {
          deleteProjectV2(input: $input) {
            projectV2 {
              id
            }
          }
        }
      `;
    
      await this.graphql(mutation, {
        input: {
          projectId: id,
        },
      });
    }
  • Tool definition including schema, description, and examples for delete_project tool.
    export const deleteProjectTool: ToolDefinition<DeleteProjectArgs> = {
      name: "delete_project",
      description: "Delete a GitHub project",
      schema: deleteProjectSchema as unknown as ToolSchema<DeleteProjectArgs>,
      examples: [
        {
          name: "Delete project",
          description: "Delete a GitHub project by ID",
          args: {
            projectId: "PVT_kwDOLhQ7gc4AOEbH"
          }
        }
      ]
    };
  • Registration of the deleteProjectTool in the ToolRegistry during initialization.
    this.registerTool(updateProjectTool);
    this.registerTool(deleteProjectTool);
  • Top-level tool dispatcher in MCP server that routes delete_project calls to the service handler.
    case "delete_project":
      return await this.service.deleteProject(args);

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/HarshKumarSharma/MCP'

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