project_create
Create a new project within an organization to manage features and tasks using SQLite-based tracking. Specify organization ID, project name, repository path, and description to establish project structure.
Instructions
PROJECT MANAGEMENT: Create a new project under an organization.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | Yes | Organization ID (case-insensitive) | |
| name | Yes | Project name | |
| repo_path | No | Path to git repo | |
| description | No | Project description |
Implementation Reference
- src/tpm_mcp/server.py:509-518 (handler)MCP tool handler that parses arguments into ProjectCreate model and delegates to db.create_project, returning JSON of created project.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)}"
- src/tpm_mcp/models.py:61-65 (schema)Pydantic model ProjectCreate defines the input schema for creating a project: required org_id and name, optional repo_path and description.class ProjectCreate(BaseModel): org_id: str name: str repo_path: str | None = None description: str | None = None
- src/tpm_mcp/server.py:456-469 (registration)Registration of the project_create tool in list_tools(), including name, description, and inputSchema matching ProjectCreate model.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"], }, ),
- src/tpm_mcp/db.py:153-178 (helper)Database method that inserts new project into SQLite 'projects' table using ProjectCreate data, handles case-insensitive org_id lookup, generates UUID id and timestamp.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), )