Skip to main content
Glama

create_draft_issue

Create draft issues in GitHub Projects V2 to capture ideas and tasks before formal issue creation.

Instructions

Create a draft issue directly in a GitHub Project V2.

Args:
    owner: The GitHub organization or user name
    project_number: The project number
    title: The draft issue title
    body: The draft issue body (optional)

Returns:
    A confirmation message with the new draft issue details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYes
project_numberYes
titleYes
bodyNo

Implementation Reference

  • Handler function for the 'create_draft_issue' tool. Registered via @mcp.tool() decorator. Delegates to GitHubClient.add_draft_issue_to_project and formats response.
    @mcp.tool()
    async def create_draft_issue(
        owner: str, project_number: int, title: str, body: str = ""
    ) -> str:
        """Create a draft issue directly in a GitHub Project V2.
    
        Args:
            owner: The GitHub organization or user name
            project_number: The project number
            title: The draft issue title
            body: The draft issue body (optional)
    
        Returns:
            A confirmation message with the new draft issue details
        """
        try:
            result = await github_client.add_draft_issue_to_project(
                owner, project_number, title, body
            )
            return (
                f"Successfully created draft issue in project #{project_number}!\n"
                f"Item ID: {result['id']}\n"
                f"Title: {title}"
            )
        except GitHubClientError as e:
            logger.error(f"Error creating draft issue in project {project_number}: {e}")
            return f"Error: Could not create draft issue. Details: {e}"
  • Helper method in GitHubClient class that executes the GraphQL mutation addProjectV2DraftIssue to create the draft issue in the project.
    async def add_draft_issue_to_project(
        self, owner: str, project_number: int, title: str, body: str = ""
    ) -> Dict[str, Any]:
        """Add a draft issue to a GitHub Project V2.
    
        Args:
            owner: The GitHub organization or user name that owns the project
            project_number: The project number
            title: The draft issue title
            body: The draft issue body (optional)
    
        Returns:
            The project item data
    
        Raises:
            GitHubClientError: If project not found or adding fails.
        """
        # Get project ID
        try:
            project_id = await self.get_project_node_id(owner, project_number)
        except GitHubClientError as e:
            logger.error(f"Cannot add draft issue: {e}")
            raise
    
        # Add draft issue to project
        add_query = """
        mutation AddDraftIssueToProject($projectId: ID!, $title: String!, $body: String) {
          addProjectV2DraftIssue(input: {
            projectId: $projectId,
            title: $title,
            body: $body
          }) {
            projectItem {
              id
            }
          }
        }
        """
    
        variables = {"projectId": project_id, "title": title, "body": body}
    
        try:
            result = await self.execute_query(add_query, variables)
            if not result.get("addProjectV2DraftIssue") or not result[
                "addProjectV2DraftIssue"
            ].get("projectItem"):
                raise GitHubClientError(
                    f"Failed to add draft issue to project {project_number}"
                )
            return result["addProjectV2DraftIssue"]["projectItem"]
        except GitHubClientError as e:
            logger.error(f"Failed to add draft issue to project {project_number}: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'create' (implying a write/mutation operation) and mentions a confirmation message return, but doesn't cover important aspects like required permissions, whether the operation is idempotent, rate limits, error conditions, or what happens if the project doesn't exist. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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 well-structured with clear sections for Args and Returns, making it easy to parse. It's appropriately sized with no redundant information. The only minor improvement would be integrating the purpose statement more seamlessly with the parameter documentation.

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?

For a mutation tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It covers basic parameter semantics but lacks critical behavioral context (permissions, error handling), doesn't explain the return value structure beyond 'confirmation message', and provides no guidance on when to use this versus sibling tools. The agent would need to make assumptions about important operational aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explicitly lists all 4 parameters with brief explanations, adding meaning beyond the schema which has 0% description coverage. It clarifies that 'body' is optional and provides context for 'owner' and 'project_number'. However, it doesn't explain parameter formats (e.g., what constitutes a valid project number) or constraints beyond what's obvious from the schema types.

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 ('create a draft issue') and resource ('directly in a GitHub Project V2'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'create_issue' or 'add_issue_to_project', which could create confusion about when to use this specific draft creation tool versus other issue-related tools.

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 like 'create_issue' or 'add_issue_to_project'. It mentions the target (GitHub Project V2) but doesn't specify prerequisites, appropriate contexts, or exclusions. The agent must infer usage from the tool name 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/Arclio/github-projects-mcp'

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