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

get_project

Retrieve project details by ID from the Goodday platform for context-aware applications.

Instructions

Get details of a specific project.

Args: project_id: The ID of the project to retrieve

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The core handler function for the 'get_project' MCP tool. It takes a project_id, fetches the project data from the Goodday API using make_goodday_request, handles errors, and formats the output using format_project.
    async def get_project(project_id: str) -> str:
        """Get details of a specific project.
    
        Args:
            project_id: The ID of the project to retrieve
        """
        data = await make_goodday_request(f"project/{project_id}")
        
        if not data:
            return "Project not found."
        
        if isinstance(data, dict) and "error" in data:
            return f"Unable to fetch project: {data.get('error', 'Unknown error')}"
        
        return format_project(data)
  • Helper function called by get_project to format the raw project dictionary into a human-readable string with defensive checks for nested data.
    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 API request helper used by get_project to make authenticated HTTP requests to the Goodday API endpoint 'project/{project_id}'.
    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)}")
  • The @mcp.tool() decorator registers the get_project function as an MCP tool.
    async def get_project(project_id: str) -> str:
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves project details, implying a read-only operation, but does not specify aspects like authentication requirements, rate limits, error handling, or what 'details' include (e.g., fields returned). For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by a concise 'Args' section. There is no wasted text, and the structure is easy to parse. It could be slightly more efficient by integrating the parameter explanation into the main description, but it remains highly concise.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It explains the purpose and parameter, but lacks details on behavior, output format, or usage context. For a simple read operation, this is acceptable but leaves gaps that could hinder an agent's understanding without further context.

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 context for the single parameter: 'project_id: The ID of the project to retrieve.' Since schema description coverage is 0% (the schema only provides a title 'Project Id' with no description), this compensates well by explaining the parameter's purpose. With 1 parameter and low schema coverage, the description effectively clarifies semantics.

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 tool's purpose: 'Get details of a specific project.' It uses a specific verb ('Get') and resource ('project'), but does not explicitly differentiate from sibling tools like 'get_projects' (which likely lists multiple projects) or 'get_project_tasks' (which focuses on tasks within a project). The purpose is clear but lacks sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'get_projects' for listing projects or 'get_project_tasks' for project-related tasks, nor does it specify prerequisites or exclusions. Usage is implied only by the tool name and description.

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