Document the PageResult attributes in a Returns section - #15
Merged
Merged
Conversation
The methods annotated `-> PageResult` now say what that result carries: a Google-style `Returns:` section lists `url`, `http_status` and `title`, each described by the tool's outputSchema property. pdoc and the docs site render it as a list under Returns, which is the column the retired hand-written reference page had. The attribute names come from the schema, so generation stops if the browser adds an output property that PageResult does not expose, instead of documenting an attribute that is not there. Closes #6.
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.
Closes #6, the last part of item 1.
#14 annotated the eight tools that declare an
outputSchemaas-> PageResult, but the docstrings still did not say what aPageResultholds, and the issue started from the Returns column the retired reference page had.generate_methods.pynow ends those docstrings with a Google-style section built from the output schema:The descriptions are the browser's, so they change with the schema. The header line says "None when absent" because the schema describes the wire, where a missing field is left out, while
PageResultsets the attribute toNone.Each property is checked against
PageResult's annotations. If the browser adds an output field the class doesn't expose, generation fails, so the docstring can't name an attribute that isn't there. The CI drift check runs the generator against nightly, so that failure surfaces on the next PR.Rendered both ways: pdoc puts it under a Returns heading as a list, and the docs site's
generate-python-reference.py(run against this branch) emits the same list under**Returns:**for all eightSessionmethods.The data tools stay
-> Anywith no Returns section. MCP gives no shape for them short of anoutputSchema, and browser#3694 deliberately left that off, so a typed return for them would need either that browser change or a hand-written map here.