get_project_detail
Retrieve detailed statistics and activity data for a specific coding project from Wakapi time tracking. Fetch project information including creation date, last activity, and development metrics.
Instructions
Retrieve a single project.
Mimics undocumented endpoint related to https://wakatime.com/developers#projects.
Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64
and prefixed with Basic.
Args: id (str, required): Project ID to fetch. user (str, required, default="current"): User ID to fetch data for (or 'current').
Returns: v1.ProjectViewModel: - data (Project): - id (str): Project ID. - name (str): Project name. - urlencoded_name (str): URL encoded name. - created_at (str): Creation timestamp. - last_heartbeat_at (str): Last activity timestamp. - human_readable_last_heartbeat_at (str): Human readable last activity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| user | No | current |
Implementation Reference
- src/mcp_tools/project_detail.py:9-39 (handler)The handler function for the 'get_project_detail' tool, decorated with @app.tool. It retrieves project details using the Wakapi client and includes input/output schema in the docstring.@app.tool async def get_project_detail(id: str, user: str = "current") -> dict[str, Any]: """Retrieve a single project. Mimics undocumented endpoint related to https://wakatime.com/developers#projects. Requires ApiKeyAuth: Set header `Authorization` to your API Key encoded as Base64 and prefixed with `Basic`. Args: id (str, required): Project ID to fetch. user (str, required, default="current"): User ID to fetch data for (or 'current'). Returns: v1.ProjectViewModel: - data (Project): - id (str): Project ID. - name (str): Project name. - urlencoded_name (str): URL encoded name. - created_at (str): Creation timestamp. - last_heartbeat_at (str): Last activity timestamp. - human_readable_last_heartbeat_at (str): Human readable last activity. """ client = get_wakapi_client() try: project = await client.get_project_detail(user=user, id=id) return project.model_dump() except Exception as e: raise ValueError(f"Failed to fetch project detail: {e}") from e
- main.py:145-147 (registration)Registration of the 'get_project_detail' tool by importing and referencing it in the initialize_tools function.from mcp_tools.project_detail import get_project_detail _ = get_project_detail # Trigger registration