Skip to main content
Glama
Samge0

MCP QQ Music Test Server

by Samge0

search_music

Search for music tracks by keyword using the MCP QQ Music Test Server. Find songs and retrieve song information with pagination controls.

Instructions

Search for music tracks

Args: keyword: Search keyword or phrase page: Page number for pagination (default: 1) num: Maximum number of results to return (default: 20)

Returns: List of music tracks matching the search criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes
pageNo
numNo

Implementation Reference

  • main.py:9-41 (handler)
    The handler function for the 'search_music' tool. It is decorated with @mcp.tool() which registers it with the MCP server. The function searches for music tracks using the qqmusic_api, processes the results to extract relevant song information, and returns a list of song details.
    @mcp.tool()
    async def search_music(keyword: str, page: int = 1, num: int = 20):
        """
        Search for music tracks
        
        Args:
            keyword: Search keyword or phrase
            page: Page number for pagination (default: 1)
            num: Maximum number of results to return (default: 20)
            
        Returns:
            List of music tracks matching the search criteria
        """
        result = await search.search_by_type(keyword=keyword, page=page, num=num)
        
        # 提取指定字段
        # json.dumps(result, ensure_ascii=False) - 这行代码没有实际作用,因为结果没有被使用
        if isinstance(result, list):
            filtered_list = []
            for item in result:
                # 提取歌曲信息而不是专辑信息
                song_info = {
                    "id": item.get("id"),
                    "mid": item.get("mid"),
                    "name": item.get("name"),
                    "pmid": item.get("pmid", ""),
                    "subtitle": item.get("subtitle", ""),
                    "time_public": item.get("time_public", ""),
                    "title": item.get("title", item.get("name", ""))
                }
                filtered_list.append(song_info)
        
        return filtered_list
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. While it mentions pagination and result limits, it doesn't describe important behavioral aspects like rate limits, authentication requirements, error conditions, or what happens with invalid inputs. For a search tool with zero annotation coverage, this leaves significant gaps.

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

Conciseness4/5

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

The description is appropriately sized and well-structured with clear sections for Args and Returns. Each sentence earns its place by providing necessary information. It could be slightly more front-loaded with the main purpose, but overall it's efficient and organized.

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

Completeness3/5

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

Given the tool's moderate complexity (3 parameters, search functionality) and the absence of both annotations and output schema, the description provides basic but incomplete coverage. It explains what the tool does and documents parameters, but lacks important context about behavior, constraints, and return format details that would be needed for comprehensive understanding.

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

Parameters4/5

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

The schema description coverage is 0%, so the description must compensate. It successfully adds meaning for all three parameters: explaining that 'keyword' is for search terms, 'page' handles pagination, and 'num' controls result count. It also provides default values. This goes well beyond what the bare schema provides, though it doesn't explain parameter constraints or formats.

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

Purpose4/5

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

The description clearly states 'Search for music tracks' which is a specific verb+resource combination. It effectively communicates the tool's purpose. However, with no sibling tools mentioned, there's no opportunity to differentiate from alternatives, preventing a perfect score.

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's no mention of prerequisites, constraints, or typical use cases. The only usage information is implicit from the parameter descriptions, which isn't sufficient for explicit guidelines.

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/Samge0/mcp-qqmusic-test-server'

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