fix: route get_templates through GetTemplatesResponse RootModel to remove startup output_schema warning - #405
Merged
AutomateIP merged 1 commit intoAug 10, 2026
Conversation
Route templates.get_templates through the existing (previously unused) GetTemplatesResponse RootModel instead of returning a bare list[GetTemplatesElement]. This was the last tool whose bare-list return annotation tripped a "missing or invalid output_schema" ValueError in get_json_schema, logging a spurious warning on every server startup. The wire-level output schema and JSON payload are byte-equivalent before and after: FastMCP already inferred an object-wrapped result array for the bare list, and it continues to do so for the array-rooted RootModel (server.py's == object guard intentionally leaves the array-root schema to FastMCP inference). This is type-hygiene plus warning removal, not a wire-behavior change. Also removes the now-resolved tech-debt note from AGENTS.md (CLAUDE.md symlink).
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
templates.get_templateswas the last tool returning a barelist[models.GetTemplatesElement]instead of a Pydantic model. That bare-listreturn annotation caused
get_json_schemato raiseValueError, whichserver.py catches and logs as "tool get_templates has a missing or invalid
output_schema" on every startup. This wires the tool to the existing (and
previously unused)
GetTemplatesResponse(RootModel), silencing the warning andaligning with the repo-wide pattern.
This is type-hygiene and warning removal, not a schema bug fix: FastMCP was
already inferring an equivalent object-rooted output schema for the bare list,
so the wire-level output schema and JSON payload are byte-equivalent before and
after. No client-visible behavior change.
Changes
src/itential_mcp/tools/templates.py: return annotation changed tomodels.GetTemplatesResponse; return value wrapped asGetTemplatesResponse(root=results); docstringReturns:updated.tests/test_tools_templates.py: assertions adapted from bare-list to thewrapped RootModel (
result.root); coverage preserved.tests/utilities/test_tool.py: added regression test assertingget_json_schema(get_templates)no longer raises and returns atype: arrayschema.
AGENTS.md: removed the now-resolved tech-debt note (item Fixes spelling error in README.md聽#6).Testing
make cipasses clean (2833 tests).startup warning gone (git-stash A/B comparison), a real
get_templatescallreturned 278 templates with unchanged wire shape,
tools/listannotations/title intact, no regression in other tools.
Related Issues
Resolves the
templates.py:get_templatesbare-list tech-debt item (AGENTS.mditem #6; roadmap Tier D1 #24 / G22).