Skip to content

Commit bedd41c

Browse files
committed
fix: mcp 서버 TypeScript 타입 에러 수정
- ToolDefinition content 타입에서 readonly 제거 및 type 리터럴 타입 적용 - filterFields에서 undefined 체크 추가
1 parent 695e292 commit bedd41c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/mcp/tools/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ToolDefinition {
1616
readonly description: string;
1717
readonly inputSchema: ZodRawShape;
1818
readonly handler: (args: Record<string, unknown>) => Promise<{
19-
content: readonly { type: string; text: string }[];
19+
content: { type: "text"; text: string }[];
2020
isError?: boolean;
2121
}>;
2222
}
@@ -82,7 +82,10 @@ function filterFields(
8282
const filtered: Record<string, string> = {};
8383
for (const key of Object.keys(row)) {
8484
if (fieldSet.has(key)) {
85-
filtered[key] = row[key];
85+
const value = row[key];
86+
if (value !== undefined) {
87+
filtered[key] = value;
88+
}
8689
}
8790
}
8891
return filtered;

0 commit comments

Comments
 (0)