Add type-prefixed keys for globally unique component identification (#2704)

This commit is contained in:
Jeremiah Lowin 2025-12-24 08:39:43 -05:00 committed by GitHub
commit aef1ccc026
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 547 additions and 445 deletions

View file

@ -8,6 +8,29 @@ tag: NEW
This guide provides migration instructions for breaking changes and major updates when upgrading between FastMCP versions.
## v3.0.0
### Component Lookup Method Parameter Names
The server lookup methods now use semantic parameter names instead of generic `key`:
- `FastMCP.get_tool(name=...)` (was `key`)
- `FastMCP.get_resource(uri=...)` (was `key`)
- `FastMCP.get_resource_template(uri=...)` (was `key`)
- `FastMCP.get_prompt(name=...)` (was `key`)
If you were passing arguments positionally, no change is needed. If you were using keyword arguments:
<CodeGroup>
```python Before
tool = await mcp.get_tool(key="my_tool")
```
```python After
tool = await mcp.get_tool(name="my_tool")
```
</CodeGroup>
## v2.14.0
### OpenAPI Parser Promotion