Skip to content

Commit ae29aae

Browse files
committed
fix(feishu): replace Type.Record(Type.String(), Type.Any()) with Type.Object({}, {additionalProperties: true}) in bitable tools
Type.Record(Type.String(), Type.Any()) serializes to patternProperties with an empty sub-schema ({}), which is rejected by strict JSON Schema 2020-12 validators such as AWS Bedrock's Anthropic API. This causes all LLM calls to fail when the affected feishu bitable tools are in the tool list. Replace with Type.Object({}, {additionalProperties: true}) which produces valid additionalProperties: true (boolean) instead of an empty {} sub-schema. Affected tools: feishu_bitable_create_record (fields), feishu_bitable_update_record (fields), feishu_bitable_create_field (property). Fixes #94547
1 parent 68f6a51 commit ae29aae

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

extensions/feishu/src/bitable.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,14 @@ const CreateRecordSchema = Type.Object({
530530
description: "Bitable app token (use feishu_bitable_get_meta to get from URL)",
531531
}),
532532
table_id: Type.String({ description: "Table ID (from URL: ?table=YYY)" }),
533-
fields: Type.Record(Type.String(), Type.Any(), {
534-
description:
535-
"Field values keyed by field name. Format by type: Text='string', Number=123, SingleSelect='Option', MultiSelect=['A','B'], DateTime=timestamp_ms, User=[{id:'ou_xxx'}], URL={text:'Display',link:'https://...'}",
536-
}),
533+
fields: Type.Object(
534+
{},
535+
{
536+
additionalProperties: true,
537+
description:
538+
"Field values keyed by field name. Format by type: Text='string', Number=123, SingleSelect='Option', MultiSelect=['A','B'], DateTime=timestamp_ms, User=[{id:'ou_xxx'}], URL={text:'Display',link:'https://...'}",
539+
},
540+
),
537541
});
538542

539543
const CreateAppSchema = Type.Object({
@@ -560,9 +564,14 @@ const CreateFieldSchema = Type.Object({
560564
minimum: 1,
561565
}),
562566
property: Type.Optional(
563-
Type.Record(Type.String(), Type.Any(), {
564-
description: "Field-specific properties (e.g., options for SingleSelect, format for Number)",
565-
}),
567+
Type.Object(
568+
{},
569+
{
570+
additionalProperties: true,
571+
description:
572+
"Field-specific properties (e.g., options for SingleSelect, format for Number)",
573+
},
574+
),
566575
),
567576
});
568577

@@ -572,9 +581,13 @@ const UpdateRecordSchema = Type.Object({
572581
}),
573582
table_id: Type.String({ description: "Table ID (from URL: ?table=YYY)" }),
574583
record_id: Type.String({ description: "Record ID to update" }),
575-
fields: Type.Record(Type.String(), Type.Any(), {
576-
description: "Field values to update (same format as create_record)",
577-
}),
584+
fields: Type.Object(
585+
{},
586+
{
587+
additionalProperties: true,
588+
description: "Field values to update (same format as create_record)",
589+
},
590+
),
578591
});
579592

580593
// ============ Tool Registration ============

0 commit comments

Comments
 (0)