Support for Resource and ResourceTemplate metadata (#1840)

Co-authored-by: Jacem Elwaar <jacem@mcpappsbuilders.com>
This commit is contained in:
Yann Jouanin 2026-01-12 15:45:31 +01:00 • committed by GitHub
commit 0da9a074d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,6 +64,7 @@ class ResourceManager:
mime_type: str | None = None,
icons: list[Icon] | None = None,
annotations: Annotations | None = None,
meta: dict[str, Any] | None = None,
) -> ResourceTemplate:
"""Add a template from a function."""
template = ResourceTemplate.from_function(
@ -75,6 +76,7 @@ class ResourceManager:
mime_type=mime_type,
icons=icons,
annotations=annotations,
meta=meta,
)
self._templates[template.uri_template] = template
return template