mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 04:54:17 +02:00
Improve error message when parsing params
This commit is contained in:
parent
b81d1a11ec
commit
1fa2e67403
1 changed files with 6 additions and 1 deletions
|
|
@ -76,7 +76,12 @@ class Tool(BaseModel):
|
|||
fn_callable,
|
||||
skip_names=[context_kwarg] if context_kwarg is not None else [],
|
||||
)
|
||||
parameters = func_arg_metadata.arg_model.model_json_schema()
|
||||
try:
|
||||
parameters = func_arg_metadata.arg_model.model_json_schema()
|
||||
except Exception as e:
|
||||
raise TypeError(
|
||||
f'Unable to parse parameters for function "{fn.__name__}": {e}'
|
||||
) from e
|
||||
|
||||
return cls(
|
||||
fn=fn_callable,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue