Skip to main content
Glama

create_project

Initialize a new Coroot project by specifying a unique name. Ensures the project name adheres to specific format rules for integration with the observability platform.

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
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • MCP tool registration for 'create_project' with input schema defined in docstring (name: str).
    @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]
  • Primary handler logic that invokes CorootClient.create_project 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, }
  • CorootClient.create_project: Performs HTTP POST to Coroot API /api/project/ endpoint 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}
  • Error handling decorator applied to create_project_impl for standardized error responses.
    def handle_errors(func: Callable[..., Any]) -> Callable[..., Any]: """Decorator to handle common errors in tool implementations.""" @wraps(func) async def wrapper(*args: Any, **kwargs: Any) -> dict[str, Any]: try: return await func(*args, **kwargs) # type: ignore[no-any-return] except ValueError as e: # Handle missing credentials or other validation errors return { "success": False, "error": str(e), "error_type": "validation", } except CorootError as e: # Handle Coroot API errors (including authentication) error_msg = str(e) if "Authentication failed" in error_msg: return { "success": False, "error": error_msg, "error_type": "authentication", } elif "401" in error_msg or "Unauthorized" in error_msg: return { "success": False, "error": "Authentication required. Please check your credentials.", "error_type": "authentication", } return { "success": False, "error": error_msg, "error_type": "api_error", } except Exception as e: # Handle unexpected errors return { "success": False, "error": f"Unexpected error: {str(e)}", "error_type": "unknown", } return wrapper

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/jamesbrink/mcp-coroot'

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