Skip to content

Commit 4e924c2

Browse files
cameroncookecodex
andcommitted
fix(device): Allow omitted platform in device tool schemas
Make the device platform schema truly optional so public device tool schemas continue to accept omitted platform values. Device tools already map a missing platform to iOS, and requiring the field would break session-default-backed calls. Co-Authored-By: OpenAI Codex <noreply@openai.com>
1 parent e0961f3 commit 4e924c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/mcp/tools/device/build-settings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ function normalizeDevicePlatform(platform?: unknown): unknown {
2121
}
2222

2323
export const devicePlatformSchema = z
24-
.preprocess(normalizeDevicePlatform, z.enum(devicePlatformValues).optional())
24+
.preprocess(normalizeDevicePlatform, z.enum(devicePlatformValues))
25+
.optional()
2526
.describe('Device platform: iOS, watchOS, tvOS, or visionOS. Defaults to iOS.');
2627

2728
export function mapDevicePlatform(platform?: DevicePlatform): XcodePlatform {

0 commit comments

Comments
 (0)