get_logo_url
Retrieve a customizable logo image URL for any company domain, with options for size, format, theme, and greyscale conversion.
Instructions
Get a direct logo image URL for a specific domain. Supports customization options like size, format, theme, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | The company domain (e.g., 'google.com', 'apple.com') | |
| size | No | Logo size/dimensions (optional) | |
| format | No | Image format (default: png) | |
| theme | No | Logo theme variant (optional) | |
| greyscale | No | Convert logo to greyscale (default: false) |
Implementation Reference
- src/index.ts:112-157 (handler)Handler function that constructs a parameterized logo URL using the logo.dev image base and returns a JSON response with the URL and options summary. Handles errors gracefully.async ({ domain, size, format, theme, greyscale }) => { try { const params = new URLSearchParams({ token: config.apiKey, }); if (size) params.append("size", size); if (format) params.append("format", format); if (theme) params.append("theme", theme); if (greyscale) params.append("greyscale", "true"); const logoUrl = `${LOGO_DEV_IMG_BASE}/${domain}?${params.toString()}`; return { content: [ { type: "text" as const, text: JSON.stringify( { domain, logoUrl, options: { size: size || "default", format: format || "png", theme: theme || "default", greyscale: greyscale || false, }, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error generating logo URL: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:105-111 (schema)Input schema using Zod for validating parameters: required domain and optional size, format, theme, greyscale.{ domain: z.string().describe("The company domain (e.g., 'google.com', 'apple.com')"), size: z.string().optional().describe("Logo size/dimensions (optional)"), format: z.enum(["png", "jpg", "webp"]).optional().describe("Image format (default: png)"), theme: z.enum(["light", "dark"]).optional().describe("Logo theme variant (optional)"), greyscale: z.boolean().optional().describe("Convert logo to greyscale (default: false)"), },
- src/index.ts:102-104 (registration)Registers the 'get_logo_url' tool on the MCP server with its name, description, input schema, and handler function.server.tool( "get_logo_url", "Get a direct logo image URL for a specific domain. Supports customization options like size, format, theme, and more.",
- src/index.ts:8-8 (helper)Constant URL base for logo.dev images, used in the get_logo_url handler to construct image URLs.const LOGO_DEV_IMG_BASE = "https://img.logo.dev";