Skip to main content
Glama

get_projects

Retrieve and filter development projects from Wakapi time tracking data to analyze coding activity and productivity insights.

Instructions

Retrieve and filter the user's projects.

operationId: get-wakatime-projects summary: Retrieve and filter the user's projects description: Mimics https://wakatime.com/developers#projects tags: [wakatime] parameters:

  • name: user in: path description: User ID to fetch data for (or 'current') required: true schema: type: string

  • name: q in: query description: Query to filter projects by schema: type: string responses: 200: description: OK schema: v1.ProjectsViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNocurrent
qNo

Implementation Reference

  • The main handler function decorated with @app.tool that implements the logic for the 'get_projects' MCP tool. It includes type annotations for parameters and return type (ProjectsViewModel), detailed OpenAPI schema in the docstring, fetches data using the Wakapi client, handles errors, and returns the projects.
    @app.tool
    async def get_projects(
        user: str = "current", q: Optional[str] = None
    ) -> ProjectsViewModel:
        """Retrieve and filter the user's projects.
    
        operationId: get-wakatime-projects
        summary: Retrieve and filter the user's projects
        description: Mimics https://wakatime.com/developers#projects
        tags: [wakatime]
        parameters:
          - name: user
            in: path
            description: User ID to fetch data for (or 'current')
            required: true
            schema:
              type: string
          - name: q
            in: query
            description: Query to filter projects by
            schema:
              type: string
        responses:
          200:
            description: OK
            schema: v1.ProjectsViewModel
    
        Requires ApiKeyAuth: Set header `Authorization` to your API Key
        encoded as Base64 and prefixed with `Basic`.
        """
        from mcp_tools.dependency_injection import get_wakapi_client
    
        logger.info(f"get_projects called with user={user}, q={q}")
        client = get_wakapi_client()
    
        try:
            projects = await client.get_projects(user=user, q=q)
            logger.info(f"get_projects result type: {type(projects)}")
            return projects
        except Exception as e:
            logger.error(f"Error in get_projects: {e}")
            raise ValueError(f"Failed to fetch projects: {e}") from e
  • main.py:133-135 (registration)
    The import statement in the initialize_tools function that triggers the registration of the get_projects tool. Importing the decorated function registers it with the MCP app.
    from mcp_tools.projects import get_projects
    
    _ = get_projects  # Trigger registration
  • OpenAPI-style schema definition in the docstring of the get_projects handler, specifying parameters (user, q), responses, and authentication requirements for input/output validation.
    """Retrieve and filter the user's projects.
    
    operationId: get-wakatime-projects
    summary: Retrieve and filter the user's projects
    description: Mimics https://wakatime.com/developers#projects
    tags: [wakatime]
    parameters:
      - name: user
        in: path
        description: User ID to fetch data for (or 'current')
        required: true
        schema:
          type: string
      - name: q
        in: query
        description: Query to filter projects by
        schema:
          type: string
    responses:
      200:
        description: OK
        schema: v1.ProjectsViewModel
    
    Requires ApiKeyAuth: Set header `Authorization` to your API Key
    encoded as Base64 and prefixed with `Basic`.
    """

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/impure0xntk/mcp-wakapi'

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