feat(mcp): add title and tags annotations to all MCP tool decorators (phase 1, #826)#968
Merged
Conversation
…(issue #826 phase 1) Adds human-readable `title` and categorization `tags` to all ~24 @mcp.tool decorators across the MCP tools package. FastMCP 3.3.1 (pinned in pyproject.toml) supports both fields natively. Tags used: notes, search, projects, cloud, schema, navigation, canvas, ui. Extends test_tool_contracts.py with an async test that asserts every registered tool has a non-empty title and at least one tag to prevent future regressions. output_schema is explicitly deferred as a follow-up (phase 2): it requires per-tool design decisions about which tools reliably return structured JSON and how to handle tools that return str|dict depending on output_format. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@gmail.com>
groksrc
added a commit
that referenced
this pull request
Jun 11, 2026
…d structured output
- Remove orphaned __api_version__ ('v0' since 2025; real API routes are /v2,
and nothing else reads the constant)
- output_schema=None so FastMCP doesn't duplicate the markdown report into
structuredContent (halves the payload)
- Add title/tags annotations so #963 and #968 are merge-order independent
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Drew Cain <groksrc@gmail.com>
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 #826
Summary
Implements Phase 1 of issue #826: adds
titleandtagsannotations to all 23@mcp.tooldecorators across 19 tool files.What changed:
title=and at least onetags=setpyproject.toml) fully supportstitle,tags, andtimeoutin@mcp.tool— verified by inspecting the installed package's method signature before editingnotes(write/read/edit/delete/move/view),search(search_notes, search, fetch),projects(list/create/delete project),cloud(cloud_info, release_notes, list_workspaces),schema(validate/infer/diff),navigation(build_context, recent_activity, list_directory),canvas,uitimeoutdeferred: the issue brief narrowed Phase 1 to titles + tags only, and no specific timeout values were specified; FastMCP docs note thattimeoutbehavior varies by transportoutput_schemaexplicitly deferred as Phase 2: requires per-tool design decisions about structured JSON vs.str|dictdepending onoutput_formatHow it was tested:
tests/mcp/test_tool_contracts.pywith an async smoke testtest_mcp_tools_have_title_and_tagsthat callsmcp.list_tools()and asserts every registered tool has a non-emptytitleand at least onetag, guarding against future regressionsReview notes
A few minor items worth a quick look:
Tag taxonomy and title placement deviate from the issue's literal proposal. The issue showed
titlenested insideannotations={...}and tags likecontent/graph. This implementation uses top-leveltitle=/tags=kwargs (the FastMCP 3.x-native, arguably better approach) and renamed categories tonotes/navigation. Reasonable and documented above, but a reviewer diffing against the issue will notice.Count framing in the summary is slightly off. The summary says "23 decorators across 19 files", but the diff also annotates 2 commented-out tools in
ui_sdk.py(search_notes_ui,read_note_ui) which are NOT registered (their import is commented out intools/__init__.py). The annotations are harmless dead-code consistent with the existing TODO pattern, but the count is slightly off.Regression test has a subtle import dependency. Tools only register because
test_tool_contracts.pyhas a module-levelfrom basic_memory.mcp import toolsimport. Without that import,mcp.list_tools()returns 0 and the test would pass vacuously. The import is present, so the test is valid today, but a shortassert tool_list(non-empty) guard or a comment would harden it against accidental import removal.🤖 Generated with Claude Code