Skip to content

Commit ed8f42c

Browse files
fix(mcp): Use Field() for optional params to fix MCP tool validation (#889)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent ac9cfee commit ed8f42c

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

airbyte/mcp/cloud_ops.py

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,18 @@ def list_deployed_cloud_source_connectors(
599599
],
600600
name_contains: Annotated[
601601
str | None,
602-
"Optional case-insensitive substring to filter sources by name",
603-
] = None,
602+
Field(
603+
description="Optional case-insensitive substring to filter sources by name",
604+
default=None,
605+
),
606+
],
604607
max_items_limit: Annotated[
605608
int | None,
606-
"Optional maximum number of items to return (default: no limit)",
607-
] = None,
609+
Field(
610+
description="Optional maximum number of items to return (default: no limit)",
611+
default=None,
612+
),
613+
],
608614
) -> list[CloudSourceResult]:
609615
"""List all deployed source connectors in the Airbyte Cloud workspace."""
610616
workspace: CloudWorkspace = _get_cloud_workspace(workspace_id)
@@ -648,12 +654,18 @@ def list_deployed_cloud_destination_connectors(
648654
],
649655
name_contains: Annotated[
650656
str | None,
651-
"Optional case-insensitive substring to filter destinations by name",
652-
] = None,
657+
Field(
658+
description="Optional case-insensitive substring to filter destinations by name",
659+
default=None,
660+
),
661+
],
653662
max_items_limit: Annotated[
654663
int | None,
655-
"Optional maximum number of items to return (default: no limit)",
656-
] = None,
664+
Field(
665+
description="Optional maximum number of items to return (default: no limit)",
666+
default=None,
667+
),
668+
],
657669
) -> list[CloudDestinationResult]:
658670
"""List all deployed destination connectors in the Airbyte Cloud workspace."""
659671
workspace: CloudWorkspace = _get_cloud_workspace(workspace_id)
@@ -955,12 +967,18 @@ def list_deployed_cloud_connections(
955967
],
956968
name_contains: Annotated[
957969
str | None,
958-
"Optional case-insensitive substring to filter connections by name",
959-
] = None,
970+
Field(
971+
description="Optional case-insensitive substring to filter connections by name",
972+
default=None,
973+
),
974+
],
960975
max_items_limit: Annotated[
961976
int | None,
962-
"Optional maximum number of items to return (default: no limit)",
963-
] = None,
977+
Field(
978+
description="Optional maximum number of items to return (default: no limit)",
979+
default=None,
980+
),
981+
],
964982
with_connection_status: Annotated[
965983
bool | None,
966984
Field(
@@ -1178,12 +1196,18 @@ def list_cloud_workspaces(
11781196
],
11791197
name_contains: Annotated[
11801198
str | None,
1181-
"Optional substring to filter workspaces by name (server-side filtering)",
1182-
] = None,
1199+
Field(
1200+
description="Optional substring to filter workspaces by name (server-side filtering)",
1201+
default=None,
1202+
),
1203+
],
11831204
max_items_limit: Annotated[
11841205
int | None,
1185-
"Optional maximum number of items to return (default: no limit)",
1186-
] = None,
1206+
Field(
1207+
description="Optional maximum number of items to return (default: no limit)",
1208+
default=None,
1209+
),
1210+
],
11871211
) -> list[CloudWorkspaceResult]:
11881212
"""List all workspaces in a specific organization.
11891213

0 commit comments

Comments
 (0)