[PR #5404] fix(mcp): add type assertion for Tool assignment #11386

Closed
opened 2026-02-16 18:16:13 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5404

State: closed
Merged: No


TypeScript was complaining that MCP client tools have FlexibleSchema but the Tool type expects FlexibleSchema. This is a type system limitation - the MCP client validates schemas at runtime before returning tools, so the runtime behavior is correct.

Adding a type assertion here is safe because the schema validation happens in the MCP client layer. The assertion just tells TypeScript what we already know at runtime.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5404 **State:** closed **Merged:** No --- TypeScript was complaining that MCP client tools have FlexibleSchema<unknown> but the Tool type expects FlexibleSchema<any>. This is a type system limitation - the MCP client validates schemas at runtime before returning tools, so the runtime behavior is correct. Adding a type assertion here is safe because the schema validation happens in the MCP client layer. The assertion just tells TypeScript what we already know at runtime.
yindo added the pull-request label 2026-02-16 18:16:13 -05:00
yindo closed this issue 2026-02-16 18:16:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11386