Skip to content

Commit 5cf0225

Browse files
committed
Improve MCP Resource docstrings.
1 parent a1f527e commit 5cf0225

File tree

1 file changed

+12
-3
lines changed
  • pydantic_ai_slim/pydantic_ai

1 file changed

+12
-3
lines changed

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def __str__(self) -> str:
101101

102102
@dataclass(repr=False, kw_only=True)
103103
class ResourceAnnotations:
104-
"""Additional properties describing MCP entities."""
104+
"""Additional properties describing MCP entities.
105+
106+
See the [resource annotations in the MCP specification](https://modelcontextprotocol.io/specification/2025-06-18/server/resources#annotations).
107+
"""
105108

106109
audience: list[mcp_types.Role] | None = None
107110
"""Intended audience for this entity."""
@@ -148,7 +151,10 @@ class BaseResource(ABC):
148151

149152
@dataclass(repr=False, kw_only=True)
150153
class Resource(BaseResource):
151-
"""A resource that can be read from an MCP server."""
154+
"""A resource that can be read from an MCP server.
155+
156+
See the [resources in the MCP specification](https://modelcontextprotocol.io/specification/2025-06-18/server/resources).
157+
"""
152158

153159
uri: str
154160
"""The URI of the resource."""
@@ -179,7 +185,10 @@ def from_mcp_sdk(cls, mcp_resource: mcp_types.Resource) -> Resource:
179185

180186
@dataclass(repr=False, kw_only=True)
181187
class ResourceTemplate(BaseResource):
182-
"""A template for parameterized resources on an MCP server."""
188+
"""A template for parameterized resources on an MCP server.
189+
190+
See the [resource templates in the MCP specification](https://modelcontextprotocol.io/specification/2025-06-18/server/resources#resource-templates).
191+
"""
183192

184193
uri_template: str
185194
"""URI template (RFC 6570) for constructing resource URIs."""

0 commit comments

Comments
 (0)