fastmcp/tests/resources
Jeremiah Lowin 12f2422e18
Refactor resource behavior and add meta support (#2598)
* feat: make ResourceContent the canonical internal type for resources

Add Resource._read() private method that always returns ResourceContent,
maintaining backwards compatibility for custom resources returning str/bytes
from read(). Includes deprecation warning when str/bytes is returned.

* fix: address review feedback for ResourceContent

- Remove ResourceContent from root exports (import from fastmcp.resources)
- Fix FunctionResource.read() return type to str | bytes | ResourceContent
- Decode base64 blobs in proxy when receiving from remote servers
- Preserve meta in ProxyResource cached content

* fix: add empty result guards in proxy resource reads
2025-12-13 11:45:38 -05:00
..
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_file_resources.py Refactor resource behavior and add meta support (#2598) 2025-12-13 11:45:38 -05:00
test_function_resources.py Refactor resource behavior and add meta support (#2598) 2025-12-13 11:45:38 -05:00
test_resource_manager.py Refactor resource behavior and add meta support (#2598) 2025-12-13 11:45:38 -05:00
test_resource_template.py Refactor resource behavior and add meta support (#2598) 2025-12-13 11:45:38 -05:00
test_resource_template_meta.py Add meta parameter support to tools, resources, templates, and prompts decorators (#1294) 2025-07-29 17:16:05 -04:00
test_resources.py Allow direct instantiation of Prompt and Resource classes (#2031) 2025-10-08 21:06:41 -04:00