Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
596281e
1
Parent(s): 076dd7b
add repr
Browse files
src/fastmcp/resources/resource.py
CHANGED
|
@@ -96,6 +96,9 @@ class Resource(FastMCPComponent, abc.ABC):
|
|
| 96 |
}
|
| 97 |
return MCPResource(**kwargs | overrides)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
class FunctionResource(Resource):
|
| 101 |
"""A resource that defers data loading by wrapping a function.
|
|
|
|
| 96 |
}
|
| 97 |
return MCPResource(**kwargs | overrides)
|
| 98 |
|
| 99 |
+
def __repr__(self) -> str:
|
| 100 |
+
return f"{self.__class__.__name__}(uri={self.uri!r}, name={self.name!r}, description={self.description!r}, tags={self.tags})"
|
| 101 |
+
|
| 102 |
|
| 103 |
class FunctionResource(Resource):
|
| 104 |
"""A resource that defers data loading by wrapping a function.
|
src/fastmcp/utilities/components.py
CHANGED
|
@@ -37,3 +37,6 @@ class FastMCPComponent(FastMCPBaseModel):
|
|
| 37 |
return False
|
| 38 |
assert isinstance(other, type(self))
|
| 39 |
return self.model_dump() == other.model_dump()
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
return False
|
| 38 |
assert isinstance(other, type(self))
|
| 39 |
return self.model_dump() == other.model_dump()
|
| 40 |
+
|
| 41 |
+
def __repr__(self) -> str:
|
| 42 |
+
return f"{self.__class__.__name__}(name={self.name!r}, description={self.description!r}, tags={self.tags})"
|