Skip to main content
Glama
leehave
by leehave

get_song_info

Retrieve detailed information about a specific song using its unique song ID within the Claude Music MCP server. Supports music management by accessing song metadata for seamless playlist creation and recommendations.

Instructions

获取歌曲详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
songIdYes歌曲ID

Implementation Reference

  • The primary handler function for the 'get_song_info' tool. Extracts songId, fetches song from database, formats and returns details or errors 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:66-78 (registration)
    Registration of the 'get_song_info' tool in ListTools handler, defining name, description, and input schema.
    name: 'get_song_info', description: '获取歌曲详细信息', inputSchema: { type: 'object', properties: { songId: { type: 'string', description: '歌曲ID', }, }, required: ['songId'], }, },
  • Helper method in MusicDatabase class that finds and returns a song by ID from the in-memory song list, invoked by the tool handler.
    async getSongById(id: string): Promise<Song | undefined> { return this.songs.find(song => song.id === id); }

Other Tools

Related Tools

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