Skip to content

Commit 6244899

Browse files
committed
tidy up if else block
1 parent 3b28fba commit 6244899

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/mcp/server/fastmcp/utilities/func_metadata.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,9 @@ def func_metadata(
183183
__base__=ArgModelBase,
184184
)
185185

186-
if sig.return_annotation is inspect.Parameter.empty:
187-
pass
188-
elif sig.return_annotation is None:
189-
pass
190-
elif sig.return_annotation is types.Image:
191-
pass
192-
else:
186+
# TODO this could be moved to a constant or passed in as param as per skip_names
187+
ignore = [inspect.Parameter.empty, None, types.Image]
188+
if sig.return_annotation not in ignore:
193189
output_schema = TypeAdapter(sig.return_annotation).json_schema()
194190

195191
return FuncMetadata(arg_model=arguments_model, output_schema=output_schema)

0 commit comments

Comments
 (0)