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

get_user_assigned_tasks

Retrieve tasks assigned to a specific user from the Goodday project management platform, with options to include open or closed tasks.

Instructions

Get tasks assigned to a specific user.

Args: user_id: The ID of the user closed: Set to true to retrieve all open and closed tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes
closedNo

Implementation Reference

  • The handler function that implements the core logic for the get_user_assigned_tasks tool. It makes an API request to fetch user-assigned tasks and formats the response using format_task.
    async def get_user_assigned_tasks(user_id: str, closed: bool = False) -> str:
        """Get tasks assigned to a specific user.
    
        Args:
            user_id: The ID of the user
            closed: Set to true to retrieve all open and closed tasks
        """
        params = []
        if closed:
            params.append("closed=true")
        
        endpoint = f"user/{user_id}/assigned-tasks"
        if params:
            endpoint += "?" + "&".join(params)
        
        data = await make_goodday_request(endpoint)
        
        if not data:
            return "No assigned tasks found."
        
        if isinstance(data, dict) and "error" in data:
            return f"Unable to fetch assigned tasks: {data.get('error', 'Unknown error')}"
        
        if not isinstance(data, list):
            return f"Unexpected response format: {str(data)}"
        
        tasks = [format_task(task) for task in data]
        return "\n---\n".join(tasks)
  • Helper function to format a single task dictionary into a human-readable string, used in the output of get_user_assigned_tasks.
    def format_task(task: dict) -> str:
        """Format a task into a readable string with safe checks."""
        if not isinstance(task, dict):
            return f"Invalid task data: {repr(task)}"
    
        # Defensive defaults in case nested keys are not dicts
        status = task.get('status') if isinstance(task.get('status'), dict) else {}
        project = task.get('project') if isinstance(task.get('project'), dict) else {}
    
        return f"""
    **Task ID:** {task.get('shortId', 'N/A')}
    **Title:** {task.get('name', 'N/A')}
    **Status:** {status.get('name', 'N/A')}
    **Project:** {project.get('name', 'N/A')}
    **Assigned To:** {task.get('assignedToUserId', 'N/A')}
    **Priority:** {task.get('priority', 'N/A')}
    **Start Date:** {task.get('startDate', 'N/A')}
    **End Date:** {task.get('endDate', 'N/A')}
    **Description:** {task.get('message', 'No description')}
    """.strip()
  • Core helper function that makes authenticated HTTP requests to the Goodday API, used by get_user_assigned_tasks to fetch the task data.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves tasks but doesn't describe return format (e.g., list structure, fields included), pagination, error handling, or authentication needs. The 'closed' parameter hint adds some context, but overall, behavioral traits are minimally covered.

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, with the core purpose stated first and parameter details following in a clear 'Args:' section. Every sentence adds value, and there's no redundant information. It could be slightly more structured but remains efficient.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but has gaps. It covers the basic purpose and parameters but lacks details on output format, error cases, and differentiation from siblings. Without annotations or output schema, it provides a minimum viable understanding but could be more complete for reliable agent use.

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 semantics beyond the input schema, which has 0% description coverage. It explains 'user_id' as 'The ID of the user' and 'closed' as 'Set to true to retrieve all open and closed tasks,' clarifying default behavior and usage. This compensates well for the schema's lack of descriptions, though it doesn't detail parameter formats or constraints.

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 tasks assigned to a specific user.' This is a specific verb ('Get') and resource ('tasks assigned to a specific user'), making the function unambiguous. However, it doesn't explicitly differentiate from siblings like 'get_user_action_required_tasks' or 'search_goodday_tasks', which might also retrieve user-related tasks.

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 doesn't mention siblings like 'get_user_action_required_tasks' (which might filter by action required) or 'search_goodday_tasks' (which might allow broader searches), nor does it specify prerequisites or exclusions. Usage is implied by the name and description alone.

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