get_random_photo
Retrieve a random photo for your project, optionally filtered by category, using the Multi-MCPs server's aggregated API access.
Instructions
Get a random photo optionally filtered by category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No |
Implementation Reference
- src/apis/unsplash/unsplash.ts:70-74 (handler)The handler function for get_random_photo tool. It checks for the Unsplash access key configuration and calls the client's getRandomPhoto method with the optional category parameter extracted from the input arguments.async get_random_photo(args: Record<string, unknown>) { if (!cfg.unsplashAccessKey) throw new Error("UNSPLASH_ACCESS_KEY is not configured"); const category = args.category ? String(args.category) : undefined; return client.getRandomPhoto(category); },
- src/apis/unsplash/unsplash.ts:44-51 (registration)Tool registration object for get_random_photo within the Unsplash registration, including name, description, and input schema.{ name: "get_random_photo", description: "Get a random photo optionally filtered by category", inputSchema: { type: "object", properties: { category: { type: "string" } }, }, },
- src/apis/unsplash/unsplash.ts:47-50 (schema)Input schema for the get_random_photo tool, defining an optional 'category' property of type string.inputSchema: { type: "object", properties: { category: { type: "string" } }, },
- src/apis/unsplash/unsplash.ts:20-22 (helper)UnsplashClient helper method that performs the actual API request to Unsplash for a random photo, using the category as a query parameter if provided.getRandomPhoto(category?: string) { return this.request("/photos/random", { headers: this.headers(), query: category ? { query: category } : undefined }); }
- src/tools/register.ts:31-31 (registration)Invocation of registerUnsplash() in the main tool registration file, which registers the get_random_photo tool among others.registerUnsplash(),