Skip to main content
Glama

search_logos

Find company logos by searching for brand names. Get matching companies with their domains and logo URLs for use in projects.

Instructions

Search for company logos by brand name or company name. Returns a list of matching companies with their domains and logo URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe brand or company name to search for (e.g., 'Google', 'Apple', 'Microsoft')

Implementation Reference

  • The asynchronous handler function for the 'search_logos' tool. It fetches search results from the Logo.dev API using the provided query, processes the response, formats the results with logo URLs, and returns them as JSON text content or an error message.
    async ({ query }) => { try { const response = await fetch( `${LOGO_DEV_API_BASE}/search?q=${encodeURIComponent(query)}`, { headers: { Authorization: `Bearer ${config.apiKey}`, }, } ); if (!response.ok) { throw new Error(`Logo.dev API error: ${response.status} ${response.statusText}`); } const data = await response.json(); const results = Array.isArray(data) ? data : []; if (results.length === 0) { return { content: [ { type: "text" as const, text: `No logos found for "${query}". Try a different search term.`, }, ], }; } const formattedResults = results.map((company: any) => ({ name: company.name || "Unknown", domain: company.domain || "Unknown", logoUrl: company.domain ? `${LOGO_DEV_IMG_BASE}/${company.domain}?token=${config.apiKey}` : null, })); return { content: [ { type: "text" as const, text: JSON.stringify( { query, count: formattedResults.length, results: formattedResults, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error searching logos: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • The input schema for the 'search_logos' tool, defining a single required string parameter 'query' with a descriptive help text.
    { query: z.string().describe("The brand or company name to search for (e.g., 'Google', 'Apple', 'Microsoft')"), },
  • src/index.ts:29-100 (registration)
    The registration of the 'search_logos' tool on the MCP server using server.tool(), specifying the tool name, description, input schema, and handler function.
    server.tool( "search_logos", "Search for company logos by brand name or company name. Returns a list of matching companies with their domains and logo URLs.", { query: z.string().describe("The brand or company name to search for (e.g., 'Google', 'Apple', 'Microsoft')"), }, async ({ query }) => { try { const response = await fetch( `${LOGO_DEV_API_BASE}/search?q=${encodeURIComponent(query)}`, { headers: { Authorization: `Bearer ${config.apiKey}`, }, } ); if (!response.ok) { throw new Error(`Logo.dev API error: ${response.status} ${response.statusText}`); } const data = await response.json(); const results = Array.isArray(data) ? data : []; if (results.length === 0) { return { content: [ { type: "text" as const, text: `No logos found for "${query}". Try a different search term.`, }, ], }; } const formattedResults = results.map((company: any) => ({ name: company.name || "Unknown", domain: company.domain || "Unknown", logoUrl: company.domain ? `${LOGO_DEV_IMG_BASE}/${company.domain}?token=${config.apiKey}` : null, })); return { content: [ { type: "text" as const, text: JSON.stringify( { query, count: formattedResults.length, results: formattedResults, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error searching logos: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } );

Other Tools

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/NOVA-3951/Logodev-MCP'

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