search_photos
Find and retrieve photos from Unsplash by entering search terms, enabling visual content discovery for projects and presentations.
Instructions
Search Unsplash photos
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| per_page | No |
Implementation Reference
- src/apis/unsplash/unsplash.ts:63-69 (handler)The handler function that executes the search_photos tool logic, validating inputs and calling the Unsplash client.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:38-42 (schema)Input schema for the search_photos tool, defining query as required string and optional per_page number.inputSchema: { type: "object", properties: { query: { type: "string" }, per_page: { type: "number" } }, required: ["query"], },
- src/apis/unsplash/unsplash.ts:35-43 (registration)Tool registration definition for search_photos within the Unsplash module's ToolRegistration.{ 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:16-18 (helper)UnsplashClient.searchPhotos method, the core API call implementation for searching photos.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)Main registration invocation including the Unsplash tools (containing search_photos) in the aggregator.registerUnsplash(),