v3-notes/get-methods-consolidation.md
This document captures the design decisions around component listing methods in FastMCP 3.0.
The server had parallel implementations for listing components:
get_tools() / _list_tools()get_resources() / _list_resources()get_prompts() / _list_prompts()get_resource_templates() / _list_resource_templates()These were nearly identical but with subtle differences in dedup keys, logging, and return types. The _list_* methods were internal and used by the MCP protocol handlers, while get_* methods were the public API.
The duplicate methods were consolidated into a single set of list_* methods. The old get_* plural methods and _list_* internal methods were both removed.
This happened in two phases:
get_* and _list_* into a single get_* method with an apply_middleware parameter.FastMCP was refactored to inherit from Provider, the methods were renamed to list_* to align with the Provider interface. The apply_middleware parameter was renamed to run_middleware with a default of True.async def list_tools(self, *, run_middleware: bool = True) -> Sequence[Tool]:
"""Canonical method for listing tools."""
...
The dict return type was removed because the key was redundant—components already have .name or .uri attributes.
# Before (v2.x)
tools = await server.get_tools()
tool = tools["my_tool"]
# After (v3.0)
tools = await server.list_tools()
tool = next(t for t in tools if t.name == "my_tool")
The run_middleware=True parameter (default) applies the middleware chain. This replaces the separate _list_*_middleware() methods.
FastMCP.list_tools() overrides Provider.list_tools()src/fastmcp/server/server.py - Canonical list_* methodssrc/fastmcp/server/providers/ - Provider base class defines the interface