lgnd_geo_sdk.pydantic_ai¶
Needs the pydantic-ai extra: pip install "lgnd-geo-sdk[pydantic-ai]".
toolset ¶
toolset(
url: str | None = None,
*,
token_directory: str | Path | None = None,
) -> MCPToolset
Return LGND Geo's MCP server as a Pydantic AI toolset.
The server's instructions, which say how its tools fit together, are passed to the model.
Use Pydantic AI's toolset methods to narrow it: .filtered(...) to allow only some tools,
.approval_required(...) to ask before calls.
Parameters:
-
url(str | None, default:None) –The MCP server URL. Defaults to
lgnd_geo_sdk.server_url(). -
token_directory(str | Path | None, default:None) –Where sign-in tokens are stored. Defaults to
lgnd_geo_sdk.default_token_directory().
Returns:
-
MCPToolset–The toolset, to pass to
pydantic_ai.Agent(toolsets=[...]). It signs in the first time; -
MCPToolset–see
lgnd_geo_sdk.auth.
Example
agent = Agent("anthropic:claude-opus-5-5", toolsets=[toolset()])
result = await agent.run("Find solar farms near Springfield, Illinois.")
print(result.output)