Basic Usage
Attach a provider by callingget_tools() and passing the result to your agent:
query_docs tool. Ask it questions about the filesystem and the provider’s sub-agent handles file traversal and content extraction.
Adding Instructions
Providers can generate usage hints. Include them in your agent’s instructions:Read/Write Control
Restrict a provider to read-only or write-only:- Audit workflows where the agent should only observe
- Notification agents that send but don’t read
- Sandboxed environments during development
Choosing a Mode
Themode parameter controls how the provider exposes itself:
- default
- agent
- tools
The provider decides optimal exposure. Most read/write providers expose
query_<id> + update_<id>.Sub-agent Model
Override the model used by the provider’s internal sub-agent:Lifecycle Management
Some providers hold async resources (MCP sessions, web backends). They requireasetup() and aclose():
MCPContextProvider- MCP server connectionWebContextProviderwith MCP backends (ExaMCPBackend, ParallelMCPBackend) - MCP connectionWikiContextProviderwith GitBackend - repo clone
SlackContextProvider,GmailContextProvider,GoogleCalendarContextProvider,GoogleDriveContextProvider- lazy connectionFilesystemContextProvider,DatabaseContextProvider- sync resources
RunContext Propagation
When a provider runs a sub-agent, it forwards auth and state from the caller:- Per-user auth tokens reach the sub-agent’s tools
- Framework-injected state (e.g., Slack’s
action_token) survives the hop - User/session isolation works across provider boundaries
session_state stay with the outer agent. Sub-agents run isolated.
Next
Build Custom Providers
Create your own provider for any data source
Provider Catalog
Browse all built-in providers