Skip to content

feat(mcp): add title and tags annotations to all MCP tool decorators (phase 1, #826)#968

Merged
groksrc merged 1 commit into
mainfrom
feat/826-tool-annotations
Jun 11, 2026
Merged

feat(mcp): add title and tags annotations to all MCP tool decorators (phase 1, #826)#968
groksrc merged 1 commit into
mainfrom
feat/826-tool-annotations

Conversation

@groksrc

@groksrc groksrc commented Jun 11, 2026

Copy link
Copy Markdown
Member

Closes #826

Summary

Implements Phase 1 of issue #826: adds title and tags annotations to all 23 @mcp.tool decorators across 19 tool files.

What changed:

  • Every registered MCP tool now has a human-readable title= and at least one tags= set
  • FastMCP 3.3.1 (already pinned in pyproject.toml) fully supports title, tags, and timeout in @mcp.tool — verified by inspecting the installed package's method signature before editing
  • Tags used to categorize tools: notes (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, ui
  • timeout deferred: the issue brief narrowed Phase 1 to titles + tags only, and no specific timeout values were specified; FastMCP docs note that timeout behavior varies by transport
  • output_schema explicitly deferred as Phase 2: requires per-tool design decisions about structured JSON vs. str|dict depending on output_format

How it was tested:

  • Extended tests/mcp/test_tool_contracts.py with an async smoke test test_mcp_tools_have_title_and_tags that calls mcp.list_tools() and asserts every registered tool has a non-empty title and at least one tag, guarding against future regressions

Review notes

A few minor items worth a quick look:

  1. Tag taxonomy and title placement deviate from the issue's literal proposal. The issue showed title nested inside annotations={...} and tags like content/graph. This implementation uses top-level title=/tags= kwargs (the FastMCP 3.x-native, arguably better approach) and renamed categories to notes/navigation. Reasonable and documented above, but a reviewer diffing against the issue will notice.

  2. 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 in tools/__init__.py). The annotations are harmless dead-code consistent with the existing TODO pattern, but the count is slightly off.

  3. Regression test has a subtle import dependency. Tools only register because test_tool_contracts.py has a module-level from basic_memory.mcp import tools import. 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 short assert tool_list (non-empty) guard or a comment would harden it against accidental import removal.

🤖 Generated with Claude Code

…(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 groksrc marked this pull request as ready for review June 11, 2026 07:28
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>
@groksrc groksrc merged commit c977037 into main Jun 11, 2026
23 checks passed
@groksrc groksrc deleted the feat/826-tool-annotations branch June 11, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand FastMCP tool annotations: output_schema, tags, title, timeout

1 participant