Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_user_collection_folders

Retrieve a list of folders from a user's Discogs music collection to organize and manage catalog items.

Instructions

Retrieve a list of folders in a user's collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Implementation Reference

  • The main handler implementation for the 'get_user_collection_folders' MCP tool. Defines the tool object with name, description, input schema, and the execute function that fetches collection folders via UserService.
    export const getUserCollectionFoldersTool: Tool<FastMCPSessionAuth, typeof UsernameInputSchema> = {
      name: 'get_user_collection_folders',
      description: `Retrieve a list of folders in a user's collection`,
      parameters: UsernameInputSchema,
      execute: async (args) => {
        try {
          const userService = new UserService();
          const collectionFolders = await userService.collection.getFolders(args);
    
          return JSON.stringify(collectionFolders);
        } catch (error) {
          throw formatDiscogsError(error);
        }
      },
    };
  • Zod input schema used by the tool, requiring a non-empty 'username' string.
    export const UsernameInputSchema = z.object({
      username: z.string().min(1, 'username is required'),
    });
  • Direct registration of the tool with the FastMCP server instance.
    server.addTool(getUserCollectionFoldersTool);
  • Top-level registration call that includes the user collection tools, encompassing 'get_user_collection_folders'.
    registerUserCollectionTools(server);

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/cswkim/discogs-mcp-server'

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