Skip to content

Conversation

@daninfpj
Copy link

Closes #1101

Fix GitHub label schema to handle null descriptions.

Description

Updates the GitHubLabelSchema to properly handle label descriptions that can be null. The GitHub API can return labels with null descriptions, but the current schema only allows string values or omitted fields. This PR updates the schema to support all possible API responses.

Server Details

  • Server: github
  • Changes to: tools (schema definitions)

Motivation and Context

The GitHub API can return labels with null descriptions, but our current schema validation fails in these cases. This causes the get_pull_request tool to fail when processing pull requests that contain labels with null descriptions.

Example error:

{"error":"MCP error -32603: Invalid input: [{\"code\":\"invalid_type\",\"expected\":\"string\",\"received\":\"null\",\"path\":[\"labels\",1,\"description\"],\"message\":\"Expected string, received null\"}]"}

How Has This Been Tested?

  • Tested with pull requests containing labels with:
    • String descriptions
    • Null descriptions
    • No description field
  • Verified that the get_pull_request tool successfully processes all cases
  • Confirmed that other tools using the GitHubLabelSchema (like list_issues) continue to work correctly

Breaking Changes

No breaking changes. This is a more permissive schema that accepts all valid GitHub API responses.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

@daninfpj daninfpj changed the title Allow null label descriptions GitHub MCP server: Allow null label descriptions Mar 27, 2025
@olaservo olaservo added bug Something isn't working server-github labels Mar 28, 2025
@olaservo
Copy link
Member

This duplicate PR was just merged: #694

@olaservo olaservo added the duplicate This issue or pull request already exists label Mar 28, 2025
@olaservo olaservo closed this Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub MCP server: GMCP error -32603: Invalid input for labels with null description

2 participants