fix: show tool descriptions in CLI tools output for all docstring styles - #409
Merged
AutomateIP merged 1 commit intoAug 13, 2026
Merged
Conversation
The itential-mcp tools CLI subcommand rendered blank descriptions for 8 tools because display_tools() hardcoded __doc__.splitlines()[1], which only worked for one docstring style and would raise AttributeError on undocumented tools. Replace the hardcoded splitlines()[1] with inspect.getdoc() plus a first-non-blank-line scan; safely handle __doc__ is None. No MCP protocol/wire impact -- display_tools is wired only from the CLI tools subcommand; FastMCP's tools/list derives descriptions independently at registration.
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.
Summary
The
itential-mcp toolsCLI subcommand rendered blank descriptions for 8tools because
display_tools()hardcoded__doc__.splitlines()[1], whichonly worked for one docstring style and raised AttributeError on
undocumented tools.
Changes
utilities/tool.py: replace the hardcodedsplitlines()[1]withinspect.getdoc()plus a first-non-blank-line scan; safely handle__doc__ is None.tests/utilities/test_tool.py: add regression guards for Google-style,leading-blank, one-liner, and undocumented docstring shapes, plus a
live test asserting the 8 previously-broken tools now render correct
summaries.
Testing
make cipasses clean (2841 tests, ruff, headers, bandit).errors, confirming they are genuine regression guards.
(
display_toolsis wired only from thetoolssubcommand; FastMCP'stools/listderives descriptions independently at registration), sono live integration run is applicable.
Related Issues
Roadmap Tier B #28.