Skip to main content
Glama
leehave
by leehave

get_song_info

Retrieve detailed song information including metadata and identifiers by providing a song ID within the Claude Music MCP server for music management tasks.

Instructions

获取歌曲详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
songIdYes歌曲ID

Implementation Reference

  • The handler function that implements the core logic of the 'get_song_info' tool. It extracts the songId from arguments, fetches the song from the music database, and returns formatted song details or throws an error if not found.
    private async handleGetSongInfo(args: any) { const { songId } = args; const song = await this.musicDb.getSongById(songId); if (!song) { throw new Error(`未找到ID为 ${songId} 的歌曲`); } return { content: [ { type: 'text', text: `🎵 歌曲信息:\n\n标题: ${song.title}\n艺术家: ${song.artist}\n专辑: ${song.album}\n发行年份: ${song.year}\n时长: ${song.duration}\n风格: ${song.genre}\n播放次数: ${song.playCount}\n评分: ${song.rating}/5`, }, ], }; }
  • src/index.ts:65-78 (registration)
    Registration of the 'get_song_info' tool in the ListTools response, including name, description, and input schema definition.
    { name: 'get_song_info', description: '获取歌曲详细信息', inputSchema: { type: 'object', properties: { songId: { type: 'string', description: '歌曲ID', }, }, required: ['songId'], }, },
  • Supporting helper method in MusicDatabase class that retrieves a song by its ID from the in-memory song list, used by the get_song_info handler.
    async getSongById(id: string): Promise<Song | undefined> { return this.songs.find(song => song.id === id); }

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/leehave/Claude-Music-Mcp'

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