fix(toolsets): send a return description the way pydantic-ai sends one - #110
Merged
Conversation
`render` appended a prose "Returns: ..." paragraph. pydantic-ai wraps a docstring's `Returns:` section in `<summary>` and `<returns>` tags instead, which is what every tool built from a docstring already sends - so a host registering these beside tools of its own put two conventions in one tool list, `create_chart` arriving as XML and `ls` as prose describing the same kind of thing. That was invented here, and inventing it was the mistake. `render` emits the framework's shape now. The test pins it against a tool pydantic-ai renders itself rather than against a string literal, so a change on that side fails here rather than leaving these tools quietly speaking the old dialect. The `*_DESCRIPTION` constants carry the new shape with them. A catalogue that wanted the prose reads `ToolText.summary`, which is the sentence it wanted in the first place - agenticos already does. Verified: 1716 tests pass, coverage 100%, pyright and mypy strict clean.
DEENUU1
added a commit
that referenced
this pull request
Aug 22, 2026
`docs/.DS_Store` was swept into #110 by a `git add docs`. Removed from the index, and `.DS_Store` added to `.gitignore` so the next staged directory does not bring it back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
renderappended a proseReturns: …paragraph. pydantic-ai does something else with a docstring'sReturns:section — it wraps the prose in<summary>and the return description in<returns>:So a host that registers these tools beside tools of its own ends up with two conventions in one tool list:
create_chart, built from a docstring, arriving as XML, andlsarriving as prose describing the same kind of thing. That shape was invented here, and inventing it was the mistake — the framework already had one.renderemits the framework's shape now.The test pins it against a tool pydantic-ai renders itself rather than against a string literal:
If pydantic-ai changes how it renders that section, this fails here rather than leaving these tools quietly speaking the old dialect.
A
ToolTextwith noreturnsis still plain prose, which is also what the framework does with a docstring that has noReturns:section.The
*_DESCRIPTIONconstants carry the new shape with them. A catalogue that wanted the prose readsToolText.summary— the sentence it wanted in the first place, and what agenticos already shows beside its approval checkboxes.Verified: 1716 tests pass, coverage 100%, pyright and mypy strict clean.