Skip to main content
Glama

delete_project_item

Remove an item from a GitHub Project V2 by specifying the owner, project number, and item ID to clean up project boards and manage workflows.

Instructions

Delete an item from a GitHub Project V2.

Args:
    owner: The GitHub organization or user name
    project_number: The project number
    item_id: The ID of the item to delete

Returns:
    A confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
project_numberYes
item_idYes

Implementation Reference

  • The primary MCP tool handler for 'delete_project_item'. Decorated with @mcp.tool() for registration. Validates inputs via type hints and docstring, delegates to GitHubClient, handles errors, and formats response.
    @mcp.tool()
    async def delete_project_item(owner: str, project_number: int, item_id: str) -> str:
        """Delete an item from a GitHub Project V2.
    
        Args:
            owner: The GitHub organization or user name
            project_number: The project number
            item_id: The ID of the item to delete
    
        Returns:
            A confirmation message
        """
        try:
            deleted_item_id = await github_client.delete_project_item(
                owner, project_number, item_id
            )
            return (
                f"Successfully deleted item from project #{project_number}!\n"
                f"Deleted Item ID: {deleted_item_id}"
            )
        except GitHubClientError as e:
            logger.error(
                f"Error deleting item {item_id} from project {project_number}: {e}"
            )
            return f"Error: Could not delete item. Details: {e}"
  • Supporting method in GitHubClient class that performs the actual GraphQL mutation to delete the project item via GitHub's API.
    async def delete_project_item(
        self, owner: str, project_number: int, item_id: str
    ) -> str:
        """Delete an item from a GitHub Project V2.
    
        Args:
            owner: The GitHub organization or user name that owns the project
            project_number: The project number
            item_id: The project item ID
    
        Returns:
            The ID of the deleted item.
    
        Raises:
            GitHubClientError: If project not found or deletion fails.
        """
        # Get project ID
        try:
            project_id = await self.get_project_node_id(owner, project_number)
        except GitHubClientError as e:
            logger.error(f"Cannot delete item: {e}")
            raise
    
        # Delete item
        delete_query = """
        mutation DeleteProjectItem($projectId: ID!, $itemId: ID!) {
          deleteProjectV2Item(input: {
            projectId: $projectId,
            itemId: $itemId
          }) {
            deletedItemId
          }
        }
        """
    
        variables = {"projectId": project_id, "itemId": item_id}
    
        try:
            result = await self.execute_query(delete_query, variables)
            if not result.get("deleteProjectV2Item") or not result[
                "deleteProjectV2Item"
            ].get("deletedItemId"):
                raise GitHubClientError(f"Failed to delete item {item_id}")
            return result["deleteProjectV2Item"]["deletedItemId"]
        except GitHubClientError as e:
            logger.error(f"Failed to delete item {item_id}: {e}")
            raise
  • The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
  • Docstring and type annotations define the input schema (parameters) and output for the MCP tool.
    """Delete an item from a GitHub Project V2.
    
    Args:
        owner: The GitHub organization or user name
        project_number: The project number
        item_id: The ID of the item to delete
    
    Returns:
        A confirmation message
    """
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 action is 'Delete', implying a destructive mutation, but doesn't specify if this is reversible, what permissions are required, or any rate limits. The mention of 'Returns: A confirmation message' hints at output but lacks detail on error handling or side effects, leaving significant gaps for a mutation tool.

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, starting with the core purpose followed by parameter explanations. The 'Args' and 'Returns' sections are structured clearly, but the 'Returns' part is slightly redundant as it doesn't add detail beyond 'confirmation message'. Overall, it's efficient with minimal waste.

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 complexity of a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical information such as authentication requirements, error conditions, whether deletion is permanent, and how it differs from sibling tools. The return value is vague ('confirmation message'), and without annotations, more behavioral context is needed for safe and effective 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 value beyond the input schema by explaining each parameter's purpose: 'owner' as the GitHub organization/user name, 'project_number' as the project number, and 'item_id' as the ID to delete. Since schema description coverage is 0% (no titles or descriptions in schema), this compensates well, though it could include format examples (e.g., 'item_id' as a string format).

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 action ('Delete') and resource ('an item from a GitHub Project V2'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_project_item_field' or 'get_project_items', which would require more nuance about when deletion versus modification or retrieval is appropriate.

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 prerequisites (e.g., authentication needs, permissions), exclusions (e.g., cannot delete certain item types), or compare to siblings like 'update_project_item_field' for modifications instead of deletions. This leaves the agent without context for tool selection.

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/Arclio/github-projects-mcp'

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