search
Query the Discogs database to find artists, labels, releases, or masters using specific filters like title, genre, year, or format. Retrieve detailed results for music catalog management.
Instructions
Issue a search query to the Discogs database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anv | No | ||
| artist | No | ||
| barcode | No | ||
| catno | No | ||
| contributor | No | ||
| country | No | ||
| credit | No | ||
| format | No | ||
| genre | No | ||
| label | No | ||
| page | No | ||
| per_page | No | ||
| q | No | ||
| release_title | No | ||
| sort | No | ||
| sort_order | No | ||
| style | No | ||
| submitter | No | ||
| title | No | ||
| track | No | ||
| type | No | ||
| year | No |
Implementation Reference
- src/tools/database.ts:237-251 (handler)The 'search' tool handler, which creates a DatabaseService instance and calls its search method with the input arguments, returning the JSON-stringified results.export const searchTool: Tool<FastMCPSessionAuth, typeof SearchParamsSchema> = { name: 'search', description: 'Issue a search query to the Discogs database', parameters: SearchParamsSchema, execute: async (args) => { try { const databaseService = new DatabaseService(); const searchResults = await databaseService.search(args); return JSON.stringify(searchResults); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/database.ts:8-30 (schema)Zod schema defining the input parameters for the 'search' tool, including query fields like q, type, title, etc., merged with common query params.export const SearchParamsSchema = z .object({ q: z.string().optional(), type: z.enum(['artist', 'label', 'master', 'release']).optional(), title: z.string().optional(), release_title: z.string().optional(), credit: z.string().optional(), artist: z.string().optional(), anv: z.string().optional(), label: z.string().optional(), genre: z.string().optional(), style: z.string().optional(), country: z.string().optional(), year: z.string().optional(), format: z.string().optional(), catno: z.string().optional(), barcode: z.string().optional(), track: z.string().optional(), submitter: z.string().optional(), contributor: z.string().optional(), }) .merge(QueryParamsSchema(['title', 'artist', 'year']));
- src/tools/database.ts:265-265 (registration)Registration of the 'search' tool to the FastMCP server in the registerDatabaseTools function.server.addTool(searchTool);