create_project
Create a new Coroot project with a specified name to organize and monitor application performance metrics, logs, and infrastructure data.
Instructions
Create a new project.
Creates a new Coroot project with the specified name. The name must contain only lowercase letters, numbers, and hyphens.
Args: name: Project name (must match ^a-z0-9?$)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/mcp_coroot/server.py:196-207 (handler)MCP tool handler for create_project: decorated with @mcp.tool(), calls the impl function, includes schema in docstring and type annotations.@mcp.tool() async def create_project(name: str) -> dict[str, Any]: """Create a new project. Creates a new Coroot project with the specified name. The name must contain only lowercase letters, numbers, and hyphens. Args: name: Project name (must match ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$) """ return await create_project_impl(name) # type: ignore[no-any-return]
- src/mcp_coroot/server.py:185-194 (helper)Implementation helper that wraps the client call and formats the response.@handle_errors async def create_project_impl(name: str) -> dict[str, Any]: """Create a new project.""" project = await get_client().create_project(name) return { "success": True, "message": "Project created successfully", "project": project, }
- src/mcp_coroot/client.py:315-338 (helper)CorootClient method that performs the actual HTTP POST to create the project.async def create_project(self, name: str) -> dict[str, Any]: """Create a new project. Args: name: Project name (must match ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$). Returns: Created project information. """ data = {"name": name} response = await self._request("POST", "/api/project/", json=data) # Handle different response types try: if response.headers.get("content-type", "").startswith("application/json"): result: dict[str, Any] = response.json() return result else: # If not JSON, return a success indicator with the name return {"id": name, "name": name} except Exception: # If parsing fails, return minimal success response return {"id": name, "name": name}