1. Limit the agent to calendar reads
Pydantic AI can filter its MCP toolset before each model step. This script makes only account status, calendar discovery and event listing available to the model. Run it locally and enter your request at the prompt.
import os
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPToolset
pear = MCPToolset(
"https://pearmcp.com/api/mcp",
headers={"Authorization": f"Bearer {os.environ['PEAR_API_KEY']}"},
)
reads = {"pear_provider_status", "pear_list_calendars", "pear_list_events"}
agent = Agent(
os.environ["AGENT_MODEL"],
toolsets=[pear.filtered(lambda ctx, tool: tool.name in reads)],
)
print(agent.run_sync(input("Calendar request: ")).output)Example requestCall pear_provider_status and pear_list_calendars. Which calendars can this account read?
What to check
Match the account and calendar names to your source app. Keep the results in the private terminal.
2. Check one day of events
Run the script again. Give the calendar name, date and timezone in the same request so the agent can resolve the calendar on this run.
Example requestUsing my Work calendar, list the events on 30 November 2026 in Australia/Sydney. Include start and end times, and identify all-day events separately. Say if a calendar read fails.
What to check
Substitute your calendar and date. Compare one known event, including the local start time, with Apple Calendar or Outlook before relying on the summary.
If the result is not what you expected
The Python import fails
Use a Pydantic AI release that documents MCPToolset. Check which Python interpreter runs the script and install pydantic-ai into that environment.
A known event is missing
Check which account owns the event, whether the calendar appeared in discovery and which timezone the date range used.
Know what you are connecting
The SDK documents this connection method. A live Pear account test with Pydantic AI is pending. Calendar details returned to the agent go to the model provider you configure. Revoke the project key in Pear when you retire the script.
Read how Pear handles your data
