Skip to content

Conversation

koic
Copy link
Member

@koic koic commented Sep 3, 2025

Motivation and Context

Since the optional title becomes title: null when not provided, the following error occurs. This occurs with Claude Code 1.0.100.

[DEBUG] MCP server "example": Connection failed after 1591ms: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "serverInfo",
      "title"
    ],
    "message": "Expected string, received null"
  }
]

By adding compact, the title key will be removed if the optional title keyword argument is not specified.

How Has This Been Tested?

Confirmed the fix for the issue in Claude Code and added and updated test cases.

Breaking Changes

None.

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 Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@koic koic force-pushed the fix_errors_when_title_is_not_specified branch from f3d25d9 to 986fdf5 Compare September 3, 2025 02:13
Since the optional `title` becomes `title: null` when not provided, the following error occurs.
This occurs with Claude Code 1.0.100.

```console
[DEBUG] MCP server "example": Connection failed after 1591ms: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "serverInfo",
      "title"
    ],
    "message": "Expected string, received null"
  }
]
```

By adding `compact`, the `title` key will be removed if the optional `title` keyword argument is not specified.
@koic koic force-pushed the fix_errors_when_title_is_not_specified branch from 986fdf5 to 47d29e8 Compare September 3, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant