-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
If the model to return by a tool is defined like:
class Foo(BaseModel):
field_first: str | None = Field(
default=None, alias="first", description="The first field."
)
field_second: str | None = Field(
default=None, alias="second", description="The second field."
)In outputSchema of tools/list they will be displayed as "first" and "second".
At the same time model_dump in
| structured_content = validated.model_dump(mode="json") |
will produce the dump with "field_first" and "field_second".
To keep the schema and the tool response consistent, consider adding by_alias=True to the call of model_dump.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers