Skip to content

Commit 8d42e69

Browse files
committed
Fix mcp compatibility
1 parent c1dfca6 commit 8d42e69

File tree

1 file changed

+4
-2
lines changed
  • pydantic_ai_slim/pydantic_ai

1 file changed

+4
-2
lines changed

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async def _sampling_callback(
208208
)
209209

210210
def _map_tool_result_part(
211-
self, part: mcp_types.Content
211+
self, part: mcp_types.ContentBlock
212212
) -> str | messages.BinaryContent | dict[str, Any] | list[Any]:
213213
# See https://github.com/jlowin/fastmcp/blob/main/docs/servers/tools.mdx#return-values
214214

@@ -239,8 +239,10 @@ def _map_tool_result_part(
239239
)
240240
else:
241241
assert_never(resource)
242+
elif isinstance(part, mcp_types.ResourceLink):
243+
raise NotImplementedError('ResourceLink is not implemented.')
242244
else:
243-
assert_never(part) # type: ignore[arg-type]
245+
assert_never(part)
244246

245247

246248
@dataclass

0 commit comments

Comments
 (0)