Skip to main content
Glama
cdmx-in
by cdmx-in

get_projects

Retrieve project lists from Goodday with options to filter archived projects or root-level projects only.

Instructions

Get list of projects from Goodday.

Args: archived: Set to true to retrieve archived/closed projects root_only: Set to true to return only root projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
root_onlyNo

Implementation Reference

  • The handler function for the get_projects MCP tool. It fetches projects from the Goodday API endpoint 'projects' with optional archived and root_only parameters, handles errors, formats each project using format_project helper, and returns a joined string of formatted projects.
    async def get_projects(archived: bool = False, root_only: bool = False) -> str:
        """Get list of projects from Goodday.
    
        Args:
            archived: Set to true to retrieve archived/closed projects
            root_only: Set to true to return only root projects
        """
        params = []
        if archived:
            params.append("archived=true")
        if root_only:
            params.append("rootOnly=true")
        
        endpoint = "projects"
        if params:
            endpoint += "?" + "&".join(params)
        
        data = await make_goodday_request(endpoint)
        
        if not data:
            return "No projects found."
            
        if isinstance(data, dict):
            if "error" in data:
                return f"Unable to fetch projects: {data.get('error', 'Unknown error')}"
        elif isinstance(data, str):
            return f"Unexpected string response from API: {data}"
        elif not isinstance(data, list):
            return f"Unexpected response format: {type(data).__name__} - {str(data)}"
        
        projects = [format_project(project) for project in data]
        return "\n---\n".join(projects)
  • Helper function used by get_projects to format individual project data into a human-readable string, including defensive checks for nested dicts.
    def format_project(project: dict) -> str:
        """Format a project into a readable string with safe checks."""
        if not isinstance(project, dict):
            return f"Invalid project data: {repr(project)}"
    
        # Defensive defaults in case nested keys are not dicts
        status = project.get('status') if isinstance(project.get('status'), dict) else {}
        owner = project.get('owner') if isinstance(project.get('owner'), dict) else {}
    
        return f"""
    Project ID: {project.get('id', 'N/A')}
    Name: {project.get('name', 'N/A')}
    Health: {project.get('health', 'N/A')}
    Status: {status.get('name', 'N/A')}
    Start Date: {project.get('startDate', 'N/A')}
    End Date: {project.get('endDate', 'N/A')}
    Progress: {project.get('progress', 0)}%
    Owner: {owner.get('name', 'N/A')}
    """.strip()
  • Core helper function for making authenticated requests to the Goodday API, used by get_projects to fetch the projects list from endpoint 'projects'.
    async def make_goodday_request(endpoint: str, method: str = "GET", data: dict = None, subfolders: bool = True) -> dict[str, Any] | list[Any] | None:
        """Make a request to the Goodday API with proper error handling."""
        api_token = os.getenv("GOODDAY_API_TOKEN")
        if not api_token:
            raise ValueError("GOODDAY_API_TOKEN environment variable is required")
        
        headers = {
            "User-Agent": USER_AGENT,
            "gd-api-token": api_token,
            "Content-Type": "application/json"
        }
        
        # Automatically add subfolders=true for project task and document endpoints if not already present
        if subfolders and endpoint.startswith("project/") and ("/tasks" in endpoint or "/documents" in endpoint):
            if "?" in endpoint:
                if "subfolders=" not in endpoint:
                    endpoint += "&subfolders=true"
            else:
                endpoint += "?subfolders=true"
        
        url = f"{GOODDAY_API_BASE}/{endpoint.lstrip('/')}"
        
        async with httpx.AsyncClient() as client:
            try:
                if method.upper() == "POST":
                    response = await client.post(url, headers=headers, json=data, timeout=30.0)
                elif method.upper() == "PUT":
                    response = await client.put(url, headers=headers, json=data, timeout=30.0)
                elif method.upper() == "DELETE":
                    response = await client.delete(url, headers=headers, timeout=30.0)
                else:
                    response = await client.get(url, headers=headers, timeout=30.0)
    
                response.raise_for_status()
                return response.json()
    
            except httpx.HTTPStatusError as e:
                raise Exception(f"HTTP error {e.response.status_code}: {e.response.text}")
            except httpx.RequestError as e:
                raise Exception(f"Request error: {str(e)}")
            except Exception as e:
                raise Exception(f"Unexpected error: {str(e)}")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only describes two filtering parameters without mentioning important behavioral aspects like: whether this is a read-only operation, what format the list returns (pagination, sorting, fields included), authentication requirements, rate limits, or error conditions. The description is insufficient for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by parameter explanations. Every sentence earns its place by providing essential information. The two-sentence format with parameter documentation is appropriately sized for this tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations, no output schema, and 0% schema description coverage, the description is incomplete. While it covers parameter semantics well, it lacks crucial information about the tool's behavior, return format, authentication requirements, and error handling. For a tool that presumably returns a list of projects, more context about what to expect would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful semantic context for both parameters that goes beyond the schema. While the schema only shows boolean parameters with titles 'Archived' and 'Root Only', the description explains what these actually mean: 'retrieve archived/closed projects' and 'return only root projects'. This provides crucial understanding of what these filters accomplish, compensating for the 0% schema description coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'list of projects from Goodday', making the purpose understandable. It distinguishes from sibling 'get_project' (singular) by indicating it returns a list, but doesn't explicitly differentiate from other project-related tools like 'get_project_tasks' or 'get_project_users'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention when you'd want a list of projects versus using other project-related tools like 'get_project' (singular) or 'search_goodday_tasks', nor does it provide any context about prerequisites or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cdmx-in/goodday-mcp'

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