Skip to content

Commit 3da6ff1

Browse files
cameroncookeclaude
andcommitted
fix(xcode-ide): Normalize standalone list-tools payload shape
Serialize bridge tools through an explicit allowlist in standalone mode to match manager output and avoid leaking new enumerable SDK fields if the Tool type changes. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cccbef6 commit 3da6ff1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/integrations/xcode-tools-bridge/standalone.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
createTextResponse,
44
type ToolResponse,
55
} from '../../utils/responses/index.ts';
6+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
67
import {
78
buildXcodeToolsBridgeStatus,
89
classifyBridgeError,
@@ -74,7 +75,7 @@ export class StandaloneXcodeToolsBridge {
7475
JSON.stringify(
7576
{
7677
toolCount: tools.length,
77-
tools,
78+
tools: tools.map((tool) => this.serializeTool(tool)),
7879
},
7980
null,
8081
2,
@@ -101,4 +102,15 @@ export class StandaloneXcodeToolsBridge {
101102
return createErrorResponse(classifyBridgeError(error, 'call'), message);
102103
}
103104
}
105+
106+
private serializeTool(tool: Tool): Record<string, unknown> {
107+
return {
108+
name: tool.name,
109+
title: tool.title,
110+
description: tool.description,
111+
inputSchema: tool.inputSchema,
112+
outputSchema: tool.outputSchema,
113+
annotations: tool.annotations,
114+
};
115+
}
104116
}

0 commit comments

Comments
 (0)