Audius MCP Server
by glassBead-tc
- src
- prompts
// Notifications prompt
export const notificationsPrompt = {
name: 'notifications',
description: 'Get information and manage notifications on Audius',
arguments: [
{
name: 'userId',
description: 'ID of the user to get notifications for',
required: true,
},
{
name: 'notificationType',
description: 'Type of notifications to focus on',
required: false,
enum: ['all', 'milestones', 'social', 'announcements', 'unread', 'settings']
},
{
name: 'limit',
description: 'Number of notifications to retrieve',
required: false,
type: 'number'
},
{
name: 'markAsRead',
description: 'Whether to mark notifications as read',
required: false,
type: 'boolean'
}
],
};
// Handler for notifications prompt
export const handleNotificationsPrompt = (args: {
userId: string;
notificationType?: 'all' | 'milestones' | 'social' | 'announcements' | 'unread' | 'settings';
limit?: number;
markAsRead?: boolean;
}) => {
// Build a user query for notifications
let userMessage = `I'd like to see notifications for the user with ID: ${args.userId} on Audius. `;
if (args.notificationType) {
switch (args.notificationType) {
case 'all':
userMessage += `Please show me all types of notifications. `;
break;
case 'milestones':
userMessage += `I'm specifically interested in milestone notifications. `;
break;
case 'social':
userMessage += `I want to see social interaction notifications like follows, reposts, and comments. `;
break;
case 'announcements':
userMessage += `I'd like to see platform announcements. `;
break;
case 'unread':
userMessage += `I want to focus on unread notifications. `;
break;
case 'settings':
userMessage += `I'd like to see and manage my notification settings. `;
break;
}
}
if (args.limit) {
userMessage += `Please limit the results to ${args.limit} notifications. `;
}
if (args.markAsRead) {
userMessage += `I'd also like to mark these notifications as read after viewing them. `;
}
userMessage += `Can you help me with these notifications?`;
// Add instructions on tools to use
const systemMessage = `
To fulfill this request, help the user manage their Audius notifications:
1. For basic notification retrieval:
- Use 'get-notifications' to fetch recent notifications
- Organize them by type and relevance
- Highlight important notifications
2. For notification management:
- Use 'mark-notifications-read' to mark specific notifications as read
- Use 'mark-all-notifications-read' for clearing all notifications
- Show notification counts with 'notification-counts'
3. For notification settings:
- Use 'notification-settings' to view current settings
- Explain how to use 'update-notification-settings' to change preferences
- Recommend useful notification settings based on user activity
4. For special notification types:
- Use 'milestone-notifications' for achievements and milestones
- Use 'announcement-notifications' for platform announcements
- Use 'notification-history' for a longer view of past notifications
Present the information in a clear, organized way and provide actionable suggestions for managing notifications effectively.
`;
// Create messages for the prompt
const messages = [
{
role: 'system',
content: {
type: 'text',
text: systemMessage,
},
},
{
role: 'user',
content: {
type: 'text',
text: userMessage,
},
},
];
return {
messages,
};
};