docs/third-party-tools.md
Pydantic AI supports integration with various third-party tool libraries, allowing you to leverage existing tool ecosystems in your agents. Third-party tools are also available as capabilities — see Extensibility for the full ecosystem.
See the MCP Client documentation for how to use MCP servers with Pydantic AI as toolsets.
If you'd like to use a tool from LangChain's community tool library with Pydantic AI, you can use the [tool_from_langchain][pydantic_ai.ext.langchain.tool_from_langchain] convenience method. Note that Pydantic AI will not validate the arguments in this case -- it's up to the model to provide arguments matching the schema specified by the LangChain tool, and up to the LangChain tool to raise an error if the arguments are invalid.
You will need to install the langchain-community package and any others required by the tool in question.
Here is how you can use the LangChain DuckDuckGoSearchRun tool, which requires the ddgs package:
from langchain_community.tools import DuckDuckGoSearchRun
from pydantic_ai import Agent
from pydantic_ai.ext.langchain import tool_from_langchain
search = DuckDuckGoSearchRun()
search_tool = tool_from_langchain(search)
agent = Agent(
'google:gemini-3-flash-preview',
tools=[search_tool],
)
result = agent.run_sync('What is the release date of Elden Ring Nightreign?') # (1)!
print(result.output)
#> Elden Ring Nightreign is planned to be released on May 30, 2025.
If you'd like to use multiple LangChain tools or a LangChain toolkit, you can use the [LangChainToolset][pydantic_ai.ext.langchain.LangChainToolset] toolset which takes a list of LangChain tools:
from langchain_community.agent_toolkits import SlackToolkit
from pydantic_ai import Agent
from pydantic_ai.ext.langchain import LangChainToolset
toolkit = SlackToolkit()
toolset = LangChainToolset(toolkit.get_tools())
agent = Agent('openai:gpt-5.2', toolsets=[toolset])
# ...