Get Prompt
Retrieve a specific prompt template with customized content. Returns structured messages for language model interactions.
Overview
The prompts/get
method retrieves a specific prompt template by name and processes it with provided arguments. The result contains structured messages ready for language model consumption.
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 - Prompt Discovery: Use prompts/list to discover available prompts and their arguments
Request Format
Request Parameters
Must be "2.0"
(JSON-RPC version)
Unique request identifier (cannot be null)
Must be "prompts/get"
Prompt retrieval parameters
Response Format
Always "2.0"
Matches the request ID exactly
Prompt content result
Example Responses
Argument Processing
Required Arguments
All arguments marked as required: true
in the prompt definition must be provided:
Optional Arguments
Optional arguments can be omitted and may have default values:
Argument Validation
Arguments are validated for:
- Presence: Required arguments must be provided
- Type: String values expected for most arguments
- Context: References to valid CRM entities (deals, contacts, etc.)
Message Structure
Role-Based Messages
Messages follow conversational structure:
user
: Instructions or questions for the language modelassistant
: Pre-filled responses or examples
Content Types
Type | Description | Use Case |
---|---|---|
text | Plain text content | Instructions, questions, analysis requests |
image | Base64-encoded images | Visual context, charts, screenshots |
audio | Base64-encoded audio | Voice instructions, recorded context |
Template Processing
Our implementation processes templates with provided arguments:
- Argument Substitution: Replace placeholders with actual values
- Context Loading: Fetch relevant data from CRM/database
- Message Assembly: Construct structured messages
- Validation: Ensure all required data is available
Content Validation Patterns
Based on our test implementation, message content is validated as follows:
Valid Content Examples:
OAuth and Permissions
Prompt Access Control
- User-specific: Users see only prompts they have permission to access
- Database-driven: Prompt permissions stored and validated in database
- Session-bound: Permissions validated per session and prompt request
Context Data Access
- Reference Validation: Context IDs validated against user’s accessible data
- Permission Checking: User must have access to referenced CRM entities
- Data Filtering: Only authorized data included in prompt context
Error Handling
Common Error Codes
Code | Meaning | Recovery |
---|---|---|
-32000 | Authentication failure | Refresh token, reinitialize session |
-32001 | Prompt not found | Check prompts/list for available prompts |
-32602 | Invalid arguments | Validate required arguments and types |
-32603 | Internal server error | Retry or contact support |
Argument Validation Errors
Implementation Notes
Request ID Requirements
- Must be unique within session
- Cannot be null (enforced by implementation)
- Used for error correlation and response matching
Session Validation
Mcp-Session-Id
header required after initialization- Session must be active and authenticated
- Invalid session returns authentication error
Template Caching
- Prompt templates cached for performance
- Argument processing optimized for common patterns
- Context data fetched efficiently from database
Performance Considerations
- Complex prompts may take longer to process
- Context data fetching optimized per prompt type
- Results not cached (dynamic content with arguments)
This method provides the core functionality for retrieving personalized, context-aware prompt templates that can be directly used with language models for various CRM and business analysis tasks.
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
.