LSP tool: line/character parameters coerced to strings despite being numbers

Resolved 💬 2 comments Opened Mar 8, 2026 by deeepanshu Closed Mar 8, 2026

Bug Description

When calling the LSP tool with numeric line and character parameters, Claude Code throws a validation error claiming the values are strings, even though they are passed as JSON numbers.

Error

InputValidationError: LSP failed due to the following issues:
The parameter `line` type is expected as `number` but provided as `string`
The parameter `character` type is expected as `number` but provided as `string`

Steps to Reproduce

  1. Have a C# LSP plugin set up (csharp-lsp)
  2. Call the LSP tool with hover operation:
{
  "operation": "hover",
  "filePath": "/path/to/file.cs",
  "line": 11,
  "character": 13
}
  1. Observe the error — despite line and character being JSON numbers, the tool framework reports them as strings.

Expected Behavior

The LSP tool should accept numeric values for line and character and forward them to the language server.

Environment

  • Claude Code version: latest
  • Model: claude-sonnet-4-6
  • OS: macOS Darwin 25.3.0 (arm64)
  • LSP plugin: csharp-lsp

Notes

The issue appears to be in the tool framework's parameter validation/serialization layer, not in the LSP server itself. The same error occurs regardless of what numeric values are passed. Other LSP plugins (typescript-lsp, pyright-lsp) may be affected as well.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗