search_photos
Search and retrieve photos from Unsplash using a query. Designed for quick access to high-quality images for projects, presentations, or personal use, integrated within the Multi-MCPs server for streamlined API interactions.
Instructions
Search Unsplash photos
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| per_page | No | ||
| query | Yes |
Implementation Reference
- src/apis/unsplash/unsplash.ts:63-69 (handler)The handler function for the 'search_photos' tool. It validates the access key configuration, extracts and validates the query parameter, optionally sets per_page, and calls the Unsplash client's searchPhotos method.async search_photos(args: Record<string, unknown>) { if (!cfg.unsplashAccessKey) throw new Error("UNSPLASH_ACCESS_KEY is not configured"); const query = String(args.query || ""); if (!query) throw new Error("query is required"); const perPage = args.per_page ? Number(args.per_page) : undefined; return client.searchPhotos(query, perPage); },
- src/apis/unsplash/unsplash.ts:35-43 (registration)The tool registration definition within the registerUnsplash() function, including name, description, and input schema.{ name: "search_photos", description: "Search Unsplash photos", inputSchema: { type: "object", properties: { query: { type: "string" }, per_page: { type: "number" } }, required: ["query"], }, },
- src/apis/unsplash/unsplash.ts:38-42 (schema)Input schema specifying 'query' as required string and optional 'per_page' as number.inputSchema: { type: "object", properties: { query: { type: "string" }, per_page: { type: "number" } }, required: ["query"], },
- src/apis/unsplash/unsplash.ts:16-18 (helper)Helper method in the UnsplashClient class that makes the HTTP request to Unsplash's /search/photos endpoint.searchPhotos(query: string, perPage?: number) { return this.request("/search/photos", { headers: this.headers(), query: { query, per_page: perPage ?? 10 } }); }
- src/tools/register.ts:31-31 (registration)Invocation of registerUnsplash() within the central registerAllTools() function to include Unsplash tools.registerUnsplash(),