Skip to main content
Glama
tracks.ts960 B
import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'; import { AudiusClient } from '../sdk-client.js'; // Resource template for track export const trackResourceTemplate = { uriTemplate: 'audius://track/{id}', name: 'Audius Track', description: 'Access track information from Audius', mimeType: 'application/json', }; // Resource handler for track export const handleTrackResource = async (uri: URL, params: { id: string }) => { try { const trackId = params.id; const audiusClient = AudiusClient.getInstance(); const track = await audiusClient.getTrack(trackId); if (!track) { throw new Error(`Track with ID ${trackId} not found`); } return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(track, null, 2) }] }; } catch (error) { console.error('Error handling track resource:', error); throw error; } };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/glassBead-tc/audius-mcp-atris'

If you have feedback or need assistance with the MCP directory API, please join our Discord server