π The fast, Pythonic way to build MCP servers and clients.
Only add tags if available
Jeremiah Lowinf03409a40b4a
diff --git a/src/fastmcp/utilities/components.py b/src/fastmcp/utilities/components.pyindex a831f60de..715084a8b 100644--- a/src/fastmcp/utilities/components.py+++ b/src/fastmcp/utilities/components.py@@ -62,7 +62,10 @@ class FastMCPComponent(FastMCPBaseModel):def get_meta(self) -> dict[str, Any]:"""Get the meta information about the component."""- return {"tags": list(self.tags)} | self.meta+ if self.tags:+ return {"tags": list(self.tags)} | self.meta+ else:+ return self.metadef with_key(self, key: str) -> Self:return self.model_copy(update={"_key": key})