Skip to main content
Glama
leehave

Claude Music MCP

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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. '获取歌曲详细信息' implies a read-only operation, but it doesn't specify what '详细信息' (detailed information) includes, whether there are rate limits, authentication requirements, error conditions, or response format. For a tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single phrase '获取歌曲详细信息' that directly states the tool's purpose. There's zero wasted language or unnecessary elaboration. It's appropriately sized for a simple lookup tool and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. While concise, it doesn't provide enough context about what '详细信息' includes, how it differs from sibling tools, or behavioral aspects. For even a simple tool, more guidance would help an agent understand when and how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage with 'songId' clearly documented as '歌曲ID' (song ID). The description doesn't add any parameter semantics beyond what the schema already provides. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '获取歌曲详细信息' (Get song details) clearly states the tool's purpose with a specific verb ('获取' - get) and resource ('歌曲详细信息' - song details). However, it doesn't distinguish this from potential sibling tools like 'search_music' or 'get_playlist' that might also retrieve song information in different contexts. The purpose is understandable but lacks differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools (search_music, get_playlist, get_recommendations) that might retrieve song-related information, but the description doesn't indicate this is for detailed metadata retrieval versus search results or playlist context. No explicit when/when-not instructions or alternative mentions are present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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