get_best_logo_url
Extract the optimal logo URL from any website by analyzing multiple sources including favicon, OpenGraph, and CSS, with automatic quality scoring for reliable results.
Instructions
从网站提取并返回最佳Logo的URL地址,适用于只需要获取最佳Logo URL的场景
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | 要分析的网站URL |
Implementation Reference
- src/index.ts:116-141 (handler)The handler function that implements the core logic for the 'get_best_logo_url' tool. It extracts the logo from the provided URL using LogoExtractor and returns the best logo URL or an error message.
private async handleGetBestLogoUrl(args: any) { const { url } = args; const analysis = await this.logoExtractor.analyzeLogo(url); // 统一错误处理方式,与analyze_logo保持一致 if (analysis.status === 'failed' || !analysis.bestCandidate) { return { content: [ { type: 'text', text: `无法从 ${url} 找到Logo。请检查网站是否存在Logo或网络连接是否正常。`, }, ], }; } return { content: [ { type: 'text', text: analysis.bestCandidate.url, }, ], }; } - src/index.ts:50-63 (schema)The input schema and tool definition for 'get_best_logo_url' in the ListTools response.
{ name: 'get_best_logo_url', description: '从网站提取并返回最佳Logo的URL地址,适用于只需要获取最佳Logo URL的场景', inputSchema: { type: 'object', properties: { url: { type: 'string', description: '要分析的网站URL', }, }, required: ['url'], }, }, - src/index.ts:93-94 (registration)Tool handler dispatch/registration in the CallToolRequestSchema switch statement.
case 'get_best_logo_url': return await this.handleGetBestLogoUrl(args);