Skip to main content
Glama

get_project

Retrieve detailed information for a specific project by providing its ID. Integrates with Goodday project management platform for context-aware queries on projects, tasks, and users.

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' tool. It makes an API request to retrieve project details by ID and formats the response using the format_project helper. The @mcp.tool() decorator registers it as an MCP tool, with input schema inferred from the function signature and docstring.
    @mcp.tool() 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 used by get_project to format the raw project data into a human-readable string, handling potential data inconsistencies safely.
    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 that performs authenticated HTTP requests to the Goodday API, used by the get_project handler.
    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)}")

Other Tools

Related 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