Skip to main content
Glama
talhaorak

Taiga MCP Bridge

by talhaorak

delete_task

Remove a task from the Taiga project management platform by specifying its task ID, enabling streamlined task management through the Taiga MCP Bridge.

Instructions

Deletes a task by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
task_idYes

Implementation Reference

  • The handler function for the MCP tool 'delete_task'. It authenticates the session, calls the Taiga API to delete the task by ID, logs the action, and returns a success status or raises appropriate errors.
    @mcp.tool("delete_task", description="Deletes a task by its ID.")
    def delete_task(session_id: str, task_id: int) -> Dict[str, Any]:
        """Deletes a task by ID."""
        logger.warning(
            f"Executing delete_task ID {task_id} for session {session_id[:8]}...")
        taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name
        try:
            # Use pytaigaclient syntax: client.resource.delete(id=...)
            taiga_client_wrapper.api.tasks.delete(id=task_id)
            logger.info(f"Task {task_id} deleted successfully.")
            return {"status": "deleted", "task_id": task_id}
        except TaigaException as e:
            logger.error(
                f"Taiga API error deleting task {task_id}: {e}", exc_info=False)
            raise e
        except Exception as e:
            logger.error(
                f"Unexpected error deleting task {task_id}: {e}", exc_info=True)
            raise RuntimeError(f"Server error deleting task: {e}")
  • Helper function used by delete_task (and other tools) to retrieve and validate the authenticated TaigaClientWrapper from the session store.
    def _get_authenticated_client(session_id: str) -> TaigaClientWrapper:
        """
        Retrieves the authenticated TaigaClientWrapper for a given session ID.
        Raises PermissionError if the session is invalid or not found.
        """
        client = active_sessions.get(session_id)
        # Also check if the client object itself exists and is authenticated
        if not client or not client.is_authenticated:
            logger.warning(f"Invalid or expired session ID provided: {session_id}")
            # Raise PermissionError - FastMCP will map this to an appropriate error response
            raise PermissionError(
                f"Invalid or expired session ID: '{session_id}'. Please login again.")
        logger.debug(f"Retrieved valid client for session ID: {session_id}")
        return client
  • src/server.py:557-557 (registration)
    The @mcp.tool decorator registers the delete_task function as an MCP tool.
    @mcp.tool("delete_task", description="Deletes a task by its ID.")

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/talhaorak/pytaiga-mcp'

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