Skip to main content
Glama

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
NameRequiredDescriptionDefault
per_pageNo
queryYes

Implementation Reference

  • 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); },
  • 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"], }, },
  • 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"], },
  • 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 } }); }
  • Invocation of registerUnsplash() within the central registerAllTools() function to include Unsplash tools.
    registerUnsplash(),

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/TaylorChen/muti-mcps'

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