In short.
This guide shows Python developers how to give Pydantic AI agents access to Grain meetings, but OAuth credentials and explicit controls are needed because tools that change data are enabled by default. It explains the Grain capability’s hosted MCP connection, account handling, tool prefixes, approvals and durable-run migration risks. Applications serving multiple users must obtain, store and refresh each user’s token. Prices, exact package versions and measured runtime performance are not established by the page, and the examples have not been executed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is limited to the complete selected page at [https://pydantic.dev/docs/ai/harness/grain/index.md], including its examples, API reference, authentication guidance, version notice and migration warnings. Linked documentation, source files, the documentation index and live Grain service behavior are excluded. No installation, OAuth flow, model call, tool call or durable-run replay was executed. Compatibility, performance, output quality, costs and rights remain unknown wherever the page does not establish them.
The overview
identity
The page documents the Grain class exported by pydantic_ai_harness. This capability connects a Pydantic AI agent to Grain’s hosted Model Context Protocol (MCP) server, which exposes tools for working with the signed-in user’s meeting records.
The guide combines installation instructions, connection examples, authentication guidance, migration warnings and an API reference. Its original address is [https://pydantic.dev/docs/ai/harness/grain/index.md].
assessment
The guide is useful for developers adding meeting search or summarization to an existing Pydantic AI application. It goes beyond a basic connection example by explaining expired-token failures, account separation, approval controls and compatibility risks.
Its practical value depends on having accessible Grain records and implementing the required authentication flow. The page does not establish how accurately an agent summarizes meetings, how quickly tools respond or how reliably the integration behaves under load.
users
The documented patterns serve both individual developers building scripts for their own Grain account and application developers connecting a separate Grain account for each user. The guide also addresses durable execution with Temporal or DBOS.
Beginners need working knowledge of Python packages, environment variables and OAuth, the sign-in process that supplies an access token. More experienced developers will find details about dependency-based credentials, custom MCP clients, toolset wrappers and replay compatibility.
capabilities
The agent can search and read accessible meetings, transcripts, notes and deals, and can create clips and tag meetings. The page also mentions coaching tools, without supplying a complete server-tool inventory. Grain account permissions determine which records the agent can reach.
Controls include read_only=True, configurable tool prefixes, suppression of server instructions with include_instructions=False, and toolset wrappers for filtering or approval. Core instrumentation records tool calls; Grain emits no spans of its own.
Using it
requirements
You need a Python environment, Pydantic AI Harness with its grain extra, an appropriate model-provider package and a Grain OAuth access token. The example uses the OpenAI provider, but the guide says to install another provider’s extra when using a different model.
Grain issues tokens through the standard MCP authorization flow and supports dynamic client registration. Grain MCP works on every Grain plan; deal and coaching tools require Business or Enterprise. Supported Python versions, exact dependency versions and model availability are not established here.
mechanism
At the start of a run, the capability connects to Grain’s hosted MCP server using an OAuth token. Server tools normally appear to the model with a grain_ prefix. The default capability ID is grain. To use two Grain accounts in one agent, give each Grain instance its own id and tool_prefix; two instances that share an id but have different settings raise an error. An app serving many users can still use a single instance with an auth function that supplies each run's token.
Credentials can come from GRAIN_ACCESS_TOKEN, a fixed auth token, local browser sign-in through auth='oauth', or a synchronous or asynchronous auth function. A function runs once per run and never falls back to the environment variable. Returning None or an empty string from that function gives the run no Grain tools.
Read-only filtering follows the server’s tool annotations rather than tool names. If no tools carry the required annotation, the agent receives no Grain tools and emits MCPReadOnlyNoToolsWarning.
setup
The documented pip command is pip install "pydantic-ai-harness[grain]" "pydantic-ai-slim[openai]". Import Agent from pydantic_ai and Grain from pydantic_ai_harness, then add a Grain instance to the agent’s capabilities. Supply a token through GRAIN_ACCESS_TOKEN or auth; auth='oauth' provides browser sign-in only on your own machine.
For an application serving multiple users, implement the OAuth connection flow, store and refresh each user’s token, and pass the current token through run dependencies to an auth function. For durable execution, the guide specifically directs developers to use run dependencies rather than a global token.
Choose read_only=True when the agent should only read records. If individual calls need approval, the page shows capability.get_toolset().approval_required() with DeferredToolRequests and directs developers to the deferred-tools workflow. YAML loading additionally requires the spec extra and registration of Grain through custom_capability_types.
example
The page’s basic example constructs an Agent with capabilities=[Grain()], calls agent.run_sync('Summarize my most recent Grain meeting'), and prints result.output. A read-only adaptation would use capabilities=[Grain(read_only=True)] with the same request.
This illustrates a personal meeting-summary assistant using the authenticated account’s accessible records. The page provides no resulting summary or execution receipt, and neither example was run for this report.
Assessment & evidence
limitations
An invalid or expired token raises httpx.HTTPStatusError with status 401 when the run starts, even with defer_loading=True. Applications remain responsible for token refresh and can return None from an auth function when a token is known to be invalid. Missing credentials without an auth function cause an error when creating the agent.
Read-only protection depends on server annotations, and read_only defaults to False. Meeting titles and transcripts can include external guests’ text and reach the model as tool output. Setting include_instructions=False excludes server instructions; it does not remove meeting text.
The tool-prefix migration has consequential compatibility risks. Approval rules, filters and ToolGuardrail configurations using old unprefixed names must be updated or retained through tool_prefix=None. Otherwise, named approval rules or guardrails can stop applying. In-flight Temporal or DBOS runs can also fail to replay recorded calls after tool names change.
Rate limits, maximum transcript sizes, service availability and runtime performance are unknown. The page points to separate output-limit functionality, but its detailed behavior is outside this page.
reasoning
The central application decision is how much meeting access and action authority to expose. Read-only filtering narrows available actions, while approval before every tool call lets a person decide which requested meeting data reaches the model. Both operate within the authenticated account’s permissions.
Account handling deserves particular attention in shared applications. A fixed token uses one account across runs, while a dependency-based auth function supplies a token separately for each run. A custom client shares one connection across runs, so it does not provide the same per-user connection pattern.
alternatives
The documented alternative connection path is to supply a FastMCP client or transport. This gives control over the URL, authentication, proxies and MCP handlers, while read_only and include_instructions still apply. A custom client cannot be combined with auth.
The page does not compare competing meeting integrations, services or agent frameworks. Relative cost, coverage, performance and implementation effort are therefore not assessed.
evidence
The supporting source is the complete Grain documentation page at [https://pydantic.dev/docs/ai/harness/grain/index.md]. It includes package commands, Python and YAML examples, API defaults, authentication behavior and migration warnings.
These are documentation claims rather than measured results. The page supplies no demonstrated meeting-summary output, benchmark, reliability study or independently verified execution result. Linked source code and supporting documentation were not examined.
Access & freshness
costs
The page states that Grain MCP works on every Grain plan and that deal and coaching tools require Business or Enterprise. It gives no subscription prices, integration charges, model-provider prices or usage allowances.
Total operating cost is unknown. There are no measured token counts, per-meeting costs or evidence supporting a claim that the integration is free.
rights
The page links to the integration’s source at [https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_harness/pydantic_ai_harness/grain/], but does not state a software license or documentation redistribution terms. Those rights are unknown from this evidence.
Token permissions govern access to Grain records. They do not establish permission to republish transcripts or other participants’ contributions. Meeting-content reuse rights, retention terms and model-provider data handling are not established by this page.
freshness
The supplied page capture is dated 15 November 2026 at 14:04:25.991 UTC. The page does not state its publication or update date or pin an exact package release.
The version notice allows API changes between minor 0.x releases, with deprecation warnings and release-note migration guidance. The documented prefix change makes package compatibility especially relevant to existing approval rules and durable runs. Current package behavior and server-provided tool annotations have not been verified.
actions
Start with a narrow task such as summarizing a recent meeting. Obtain the Grain OAuth token, install the integration and chosen model-provider extra, and decide whether to expose read-only tools or require approval for calls. Confirm the account has access to the intended meetings and the plan supports any required deal or coaching tools.
Before adapting an existing application, review tool-name references in filters, approvals and guardrails. Plan for in-flight durable runs before changing prefixes. Applications serving multiple users should implement token storage and refresh and supply credentials per run. Confirm current versions, prices and applicable usage rights before deployment.
