Skip to main content
Glama

project_create

Create a new project within an organization by specifying name, organization ID, repository path, and description to establish project structure.

Instructions

PROJECT MANAGEMENT: Create a new project under an organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
org_idYesOrganization ID (case-insensitive)
nameYesProject name
repo_pathNoPath to git repo
descriptionNoProject description

Implementation Reference

  • Handler logic for the 'project_create' tool: parses arguments into ProjectCreate model, calls db.create_project, and returns JSON response.
    if name == "project_create":
        project = db.create_project(
            ProjectCreate(
                org_id=args["org_id"],
                name=args["name"],
                repo_path=args.get("repo_path"),
                description=args.get("description"),
            )
        )
        return f"Created project: {_json(project)}"
  • Registration of the 'project_create' tool in the MCP server's list_tools() handler, including input schema definition.
    Tool(
        name="project_create",
        description="PROJECT MANAGEMENT: Create a new project under an organization.",
        inputSchema={
            "type": "object",
            "properties": {
                "org_id": {"type": "string", "description": "Organization ID (case-insensitive)"},
                "name": {"type": "string", "description": "Project name"},
                "repo_path": {"type": "string", "description": "Path to git repo"},
                "description": {"type": "string", "description": "Project description"},
            },
            "required": ["org_id", "name"],
        },
    ),
  • Pydantic model defining the input schema for creating a project (org_id, name, optional repo_path and description).
    class ProjectCreate(BaseModel):
        org_id: str
        name: str
        repo_path: str | None = None
        description: str | None = None
  • Database helper method that inserts a new project record into the SQLite database using the provided ProjectCreate data.
    def create_project(self, data: ProjectCreate) -> Project:
        id = self._gen_id()
        now = self._now()
        normalized_org_id = self._normalize_id(data.org_id)
        # Check if a case-insensitive match already exists for org_id
        existing_org = self.conn.execute(
            "SELECT id FROM orgs WHERE LOWER(id) = ?", (normalized_org_id,)
        ).fetchone()
        if existing_org:
            org_id = existing_org["id"]  # Use existing org ID
        else:
            org_id = normalized_org_id  # Use normalized org_id for new entries
        self.conn.execute(
            """INSERT INTO projects (id, org_id, name, repo_path, description, created_at)
               VALUES (?, ?, ?, ?, ?, ?)""",
            (id, org_id, data.name, data.repo_path, data.description, now),
        )
        self.conn.commit()
        return Project(
            id=id,
            org_id=org_id,
            name=data.name,
            repo_path=data.repo_path,
            description=data.description,
            created_at=datetime.fromisoformat(now),
        )

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/urjitbhatia/tpm-mcp'

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