Field loss in transform and provider create_resource() methods
Summary
Three related bugs where fields are silently dropped when creating resources from templates or providers:
Bug 1: FunctionResourceTemplate.create_resource() drops fields
src/fastmcp/resources/template.py:440-449 creates resources via Resource.from_function() but never passes icons, annotations, meta, or title — even though Resource.from_function accepts these parameters.
Bug 2: FastMCPProviderResourceTemplate.create_resource() drops fields
src/fastmcp/server/providers/fastmcp_provider.py:368-384 has the same issue — creates FastMCPProviderResource without icons, tags, annotations, task_config, meta, title, or auth.
Bug 3: Namespace transform loses original_name
src/fastmcp/server/transforms/namespace.py:100 uses model_copy(update={"name": ...}) to rename tools, but doesn't preserve original_name via fastmcp.delegate.original_name. This is inconsistent with FastMCPProviderTool.wrap() which does preserve the original name.
Impact
- Icon annotations on resource templates are silently lost
- Telemetry delegation spans lose
fastmcp.delegate.original_name for namespaced tools
tags and auth settings on mounted resource templates are ignored
Fix Suggestion
Add icons, annotations, meta, title to the Resource.from_function() call in templates. Add original_name preservation to Namespace transform.
Field loss in transform and provider
create_resource()methodsSummary
Three related bugs where fields are silently dropped when creating resources from templates or providers:
Bug 1:
FunctionResourceTemplate.create_resource()drops fieldssrc/fastmcp/resources/template.py:440-449creates resources viaResource.from_function()but never passesicons,annotations,meta, ortitle— even thoughResource.from_functionaccepts these parameters.Bug 2:
FastMCPProviderResourceTemplate.create_resource()drops fieldssrc/fastmcp/server/providers/fastmcp_provider.py:368-384has the same issue — createsFastMCPProviderResourcewithouticons,tags,annotations,task_config,meta,title, orauth.Bug 3:
Namespacetransform losesoriginal_namesrc/fastmcp/server/transforms/namespace.py:100usesmodel_copy(update={"name": ...})to rename tools, but doesn't preserveoriginal_nameviafastmcp.delegate.original_name. This is inconsistent withFastMCPProviderTool.wrap()which does preserve the original name.Impact
fastmcp.delegate.original_namefor namespaced toolstagsandauthsettings on mounted resource templates are ignoredFix Suggestion
Add
icons,annotations,meta,titleto theResource.from_function()call in templates. Addoriginal_namepreservation toNamespacetransform.