Skip to main content
Glama
jotraynor

Soulseek MCP Server

by jotraynor

download

Download music files from Soulseek peers by specifying the username and file path from search results.

Instructions

Download a file from a Soulseek peer. Use the username and filename from search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername of the peer to download from
filenameYesFull file path from search results

Implementation Reference

  • MCP tool handler for 'download': parses input with downloadSchema, calls soulseekClient.download(), formats and returns success message with file details.
    case 'download': {
      const parsed = downloadSchema.parse(args);
      const result = await soulseekClient.download(parsed.username, parsed.filename);
    
      return {
        content: [
          {
            type: 'text',
            text: `Download complete!\n\nFile: ${result.filename}\nSize: ${formatSize(result.size)}\nSaved to: ${result.filePath}`,
          },
        ],
      };
    }
  • Zod schema for validating 'download' tool input arguments: username and filename.
    const downloadSchema = z.object({
      username: z.string().describe('Username of the peer to download from'),
      filename: z.string().describe('Full file path from search results'),
    });
  • src/index.ts:92-109 (registration)
    Registration of 'download' tool in ListToolsRequestSchema handler: defines name, description, and inputSchema.
    {
      name: 'download',
      description: 'Download a file from a Soulseek peer. Use the username and filename from search results.',
      inputSchema: {
        type: 'object',
        properties: {
          username: {
            type: 'string',
            description: 'Username of the peer to download from',
          },
          filename: {
            type: 'string',
            description: 'Full file path from search results',
          },
        },
        required: ['username', 'filename'],
      },
    },
  • Core download implementation in SoulseekClientWrapper: ensures connection, creates download dir, downloads via SlskClient, pipes stream to file, returns DownloadResult.
    async download(username: string, filename: string): Promise<DownloadResult> {
      await this.ensureConnected();
    
      if (!this.client) {
        throw new Error('Client not connected');
      }
    
      // Ensure download directory exists
      await fs.promises.mkdir(this.downloadPath, { recursive: true });
    
      // Extract just the filename from the full path
      const basename = path.basename(filename.replace(/\\/g, '/'));
      const filePath = path.join(this.downloadPath, basename);
    
      try {
        const download = await this.client.download(username, filename);
    
        // Write the stream to file
        const writeStream = fs.createWriteStream(filePath);
    
        return new Promise((resolve, reject) => {
          let totalBytes = 0;
    
          download.stream.on('data', (chunk: Buffer) => {
            totalBytes += chunk.length;
          });
    
          download.stream.pipe(writeStream);
    
          download.stream.on('end', () => {
            console.error(`[Soulseek] Download complete: ${basename} (${totalBytes} bytes)`);
            resolve({
              success: true,
              filePath,
              filename: basename,
              size: totalBytes,
            });
          });
    
          download.stream.on('error', (err: Error) => {
            reject(new Error(`Download stream error: ${err.message}`));
          });
    
          writeStream.on('error', (err: Error) => {
            reject(new Error(`Write error: ${err.message}`));
          });
        });
      } catch (error) {
        throw new Error(`Download failed: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • TypeScript interface defining the structure of the download result returned by the download helper.
    export interface DownloadResult {
      success: boolean;
      filePath: string;
      filename: string;
      size: number;
    }
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. It mentions the action ('Download') but doesn't describe what happens during the download process, whether it requires specific permissions, if there are rate limits, how failures are handled, or what the expected outcome is. The description provides minimal behavioral context beyond the basic action.

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 with only two sentences that directly address the tool's purpose and parameter usage. Every word earns its place, and the information is front-loaded with the core purpose stated first. There is zero wasted text or redundancy.

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?

For a download operation with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (success/failure indicators, download progress, file location), doesn't mention potential errors or constraints, and provides minimal behavioral context. Given the complexity of a file download operation, more completeness is needed.

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 both parameters clearly documented in the schema itself. The description adds marginal value by specifying that parameters should come 'from search results,' which provides context about parameter sourcing but doesn't add significant semantic meaning beyond what the schema already provides. This meets the baseline for high schema coverage.

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 action ('Download a file') and the resource ('from a Soulseek peer'), providing specific verb+resource pairing. It distinguishes from sibling tools like 'get_status' and 'search' by focusing on file retrieval rather than status checking or searching. However, it doesn't explicitly differentiate from potential alternative download methods or tools.

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

Usage Guidelines3/5

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

The description provides some implied usage guidance by mentioning 'Use the username and filename from search results,' which suggests this tool should be used after search operations. However, it doesn't explicitly state when to use this tool versus alternatives, nor does it provide clear exclusions or prerequisites beyond the parameter sourcing.

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/jotraynor/SoulseekMCP'

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