raise ValueError for bool inputs instead of returning as-is
Agent-Logs-Url: https://github.com/dylanlangston/nextcloud-mcp-server/sessions/0360ab28-8913-450e-8c61-697e71ba9742 Co-authored-by: dylanlangston <16236219+dylanlangston@users.noreply.github.com>
This commit is contained in:
co-authored by
dylanlangston
parent
6ae30acc6f
commit
480504f8b5
@@ -64,7 +64,8 @@ class Nutrition(BaseModel):
|
|||||||
stores whatever the source provided.
|
stores whatever the source provided.
|
||||||
"""
|
"""
|
||||||
if isinstance(v, bool):
|
if isinstance(v, bool):
|
||||||
return v
|
msg = "boolean values are not valid for nutrition fields"
|
||||||
|
raise ValueError(msg)
|
||||||
if isinstance(v, (int, float)):
|
if isinstance(v, (int, float)):
|
||||||
return str(v)
|
return str(v)
|
||||||
return v
|
return v
|
||||||
|
|||||||
Reference in New Issue
Block a user