Skip to content

Commit 75c863e

Browse files
fix(feishu): allow number/boolean/array types in bitable fields parameter
The fields parameter in CreateRecordSchema and UpdateRecordSchema uses Type.Any() which serializes to an empty JSON Schema {}. This makes the LLM default to passing all values as strings, even for numeric fields where number type is expected. Change Type.Any() to Type.Union([...]) so the JSON Schema explicitly advertises type: [string,number,boolean,array,object], allowing the LLM to correctly pass number/boolean/array values.
1 parent 4ecb45b commit 75c863e

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

extensions/feishu/src/bitable.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,13 @@ 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(), {
533+
fields: Type.Record(Type.String(), Type.Union([
534+
Type.String(),
535+
Type.Number(),
536+
Type.Boolean(),
537+
Type.Array(Type.Any()),
538+
Type.Record(Type.String(), Type.Any()),
539+
]), {
534540
description:
535541
"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://...'}",
536542
}),
@@ -572,7 +578,13 @@ const UpdateRecordSchema = Type.Object({
572578
}),
573579
table_id: Type.String({ description: "Table ID (from URL: ?table=YYY)" }),
574580
record_id: Type.String({ description: "Record ID to update" }),
575-
fields: Type.Record(Type.String(), Type.Any(), {
581+
fields: Type.Record(Type.String(), Type.Union([
582+
Type.String(),
583+
Type.Number(),
584+
Type.Boolean(),
585+
Type.Array(Type.Any()),
586+
Type.Record(Type.String(), Type.Any()),
587+
]), {
576588
description: "Field values to update (same format as create_record)",
577589
}),
578590
});

0 commit comments

Comments
 (0)