Fix errors when title is not specified

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.
This commit is contained in:
Koichi ITO 2025-09-03 02:13:39 +09:00
commit 47d29e8014

View file

@ -222,7 +222,7 @@ module MCP
name:,
title:,
version:,
}
}.compact
end
def init(request)