A couple of fixes for the docs generator (#524)

Display "This tool does not take any parameters." when the tool
interface has no arguments other than context.

Prevent the same Enum from being referenced multiple times in the
reference.mdx file.
This commit is contained in:
Renato Byrro 2025-08-01 11:42:14 -03:00 committed by GitHub
parent 02a0900846
commit 21f892c0a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,8 +121,12 @@ def build_reference_mdx(
enum_mdx_template: str = ENUM_MDX,
) -> str:
enum_items = ""
enum_names_seen = set()
for enum_name, enum_class in referenced_enums:
if enum_name in enum_names_seen:
continue
enum_names_seen.add(enum_name)
enum_items += enum_item_template.format(
enum_name=enum_name,
enum_values=build_enum_values(
@ -246,6 +250,9 @@ def build_tool_spec(
tool_parameter_template=tool_parameter_template,
)
if not parameters:
parameters = "This tool does not take any parameters."
secrets = (
build_tool_secrets(
secrets=tool.requirements.secrets,