Read Resource
Read a specific resource by URI. Returns resource content with text or blob data based on MIME type.
Overview
The resources/read
method retrieves the content of a specific resource by its URI. Resources can contain text data, binary data (base64-encoded), or structured information depending on their MIME type.
Prerequisites
- Session Initialization: Complete
initialize
→notifications/initialized
flow - Authentication: Valid OAuth token or PAT with
mcp.read
scope - Session ID: Include
Mcp-Session-Id
header from initialization - Resource Discovery: Use resources/list to discover available resource URIs
Request Format
Request Parameters
Must be "2.0"
(JSON-RPC version)
Unique request identifier (cannot be null)
Must be "resources/read"
Resource read parameters
Response Format
Always "2.0"
Matches the request ID exactly
Resource content result
Example Responses
Content Types and Encoding
Text Content
Text-based resources return content in the text
field:
- JSON Data: Structured CRM data (deals, contacts, activities)
- Plain Text: Notes, descriptions, logs
- CSV Data: Exported data tables
- HTML: Formatted content
Binary Content
Binary resources return base64-encoded data in the blob
field:
- PDF Documents: Proposals, contracts, reports
- Images: Screenshots, diagrams, photos
- Archives: ZIP files, compressed data
- Other Files: Any binary file type
Content Validation
Each content item must have either text
or blob
, but not both:
URI Validation and Access Control
URI Format Validation
Resource URIs must:
- Follow valid URI syntax with scheme and path
- Use supported schemes (
pipedrive://
) - Reference existing resources in the user’s data scope
- Contain valid identifiers and paths
Permission Checking
Access is controlled at multiple levels:
- OAuth Token: Valid token with
mcp.read
scope - Session: Active session with proper authentication
- Resource Permission: User must have access to specific resource
- Data Ownership: Resource must be accessible to user’s client_id
Error Conditions
Condition | Error Code | Description |
---|---|---|
Invalid URI format | -32602 | Malformed URI parameter |
Resource not found | -32001 | URI doesn’t reference existing resource |
Access denied | -32001 | User lacks permission for resource |
Session invalid | -32000 | Authentication failure |
Implementation Notes
Request ID Requirements
- Must be unique within session
- Cannot be null (enforced by implementation)
- Used for error correlation and response tracking
Session Validation
Mcp-Session-Id
header required after initialization- Session must be active and authenticated
- Invalid session returns authentication error
Content Processing
- Text content returned as-is (no additional encoding)
- Binary content base64-encoded for JSON transport
- MIME types accurately reflect actual content
- Large files may be chunked or compressed
Performance Considerations
- Resource content cached where appropriate
- Large binary files may have size limits
- Database queries optimized for resource retrieval
- Binary encoding adds ~33% overhead to file size
Error Handling
- -32000: Authentication/session errors
- -32001: Resource not found or access denied
- -32602: Invalid URI parameter
- -32603: Internal server error
Content Size Limits
- Text content: Generally no strict limit
- Binary content: May have size restrictions for performance
- Base64 encoding increases binary file size by ~33%
- Large files may require alternative access methods
MIME Type Detection
- MIME types automatically detected from content
- Override capability for specific resource types
- Standard MIME types used for consistency
- Custom types supported for specialized content
This method provides access to the actual resource content, enabling language models to process CRM data, documents, and other contextual information for analysis and interaction.
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
MCP session ID (required after initialization)
"session_abc123"
Path Parameters
Tenant identifier (e.g., 'pipedrive', 'salesforce', 'hubspot')
"pipedrive"
Body
Response
JSON-RPC 2.0 response
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.
The response is of type object
.