Skip to main content
Glama
superseoworld

MCP Spotify Server

get_track

Retrieve detailed Spotify catalog information for a specific track using its ID or URI, providing metadata like artist, album, and duration.

Instructions

Get Spotify catalog information for a track

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI for the track

Implementation Reference

  • The core handler function that executes the 'get_track' tool logic: extracts the track ID from URI if needed and fetches the track details from Spotify API.
    async getTrack(args: TrackArgs) {
      const trackId = this.extractTrackId(args.id);
      return this.api.makeRequest(`/tracks/${trackId}`);
    }
  • TypeScript interface defining the input schema for the 'get_track' tool: requires a track ID or URI.
    export interface TrackArgs {
      id: string;
    }
  • src/index.ts:295-308 (registration)
    Registers the 'get_track' tool in the MCP server's listTools response, including name, description, and input schema.
    {
      name: 'get_track',
      description: 'Get Spotify catalog information for a track',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The Spotify ID or URI for the track'
          }
        },
        required: ['id']
      },
    },
  • src/index.ts:774-780 (registration)
    Handles incoming calls to the 'get_track' tool in the MCP server's CallToolRequestSchema by validating args and delegating to TracksHandler.getTrack.
    case 'get_track': {
      const args = this.validateArgs<TrackArgs>(request.params.arguments, ['id']);
      const result = await this.tracksHandler.getTrack(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Helper method used by getTrack to normalize track IDs from Spotify URIs to plain IDs.
    private extractTrackId(id: string): string {
      return id.startsWith('spotify:track:') ? id.split(':')[2] : id;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't describe key traits such as whether this is a read-only operation, potential rate limits, authentication requirements, error handling, or the format of returned information. For a tool with no annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly. There is no wasted verbiage, and every part of the sentence contributes to understanding the tool's function.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't cover behavioral aspects like authentication needs or rate limits, doesn't explain what 'catalog information' entails in the return value, and offers no usage guidelines. For a tool in a context with many siblings and no structured output, more comprehensive description is needed to compensate.

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 the 'id' parameter clearly documented as 'The Spotify ID or URI for the track'. The description doesn't add any additional semantic context beyond this, such as examples of valid IDs or URIs, but since the schema provides complete coverage, the baseline score of 3 is appropriate as the description doesn't detract from the schema's information.

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 the verb ('Get') and resource ('Spotify catalog information for a track'), making the purpose specific and understandable. However, it doesn't explicitly distinguish this tool from similar siblings like 'get_album' or 'get_artist', which also retrieve catalog information but for different resource types, leaving some ambiguity in sibling 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. It doesn't mention prerequisites (e.g., needing authentication via 'get_access_token'), compare it to other catalog tools (e.g., 'get_album' for albums), or indicate scenarios where it's preferred over broader tools like 'search'. This lack of contextual usage information limits its effectiveness for an AI agent.

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/superseoworld/mcp-spotify'

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