Skip to content

Use docstring from parent methods in tool automatic description retrieval #11576

@HectorBst

Description

@HectorBst
  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
Actually, when adding a HTTP API or a MCP Tool, if the function is a method overriding an inherited one, only the docstring of the concrete method is used, without searching in the hierarchy, making it mandatory to copy paste the parent method docstring to make it available in the MCP Tool description.

Describe the solution you'd like
Use the docstring from parent methods if the concrete method does not have one.

Additional context
The standard function inspect.getdoc provide this feature. Using it instead of fn.__doc__ in utils.py could help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions