generate_etsy_seo
Generate SEO-optimized Etsy product titles, descriptions, and tags to help your listings rank higher in search results and attract more customers.
Instructions
Generate SEO-optimized Etsy product title, description, and tags. Free: 10 generations/month.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Optional product category (e.g., "Home & Living") | |
| product_name | Yes | The product name to generate SEO for |
Implementation Reference
- mcp-server.js:422-472 (handler)The core handler function `generateEtsySEO` that validates credentials, constructs a signed payload, calls the Seerxo API, and returns the generated Etsy SEO content (title, description, tags, suggested price, usage).async function generateEtsySEO(productName, category = '') { if (!userEmail) { throw new Error('Email is not set. Run "seerxo configure" first.'); } if (!apiKeyHeader || !apiKeySecret) { throw new Error('API key is not set. Run "seerxo configure" first.'); } try { const payload = { product_name: productName, category: category || '', email: userEmail, }; const { signature, timestamp } = generateSignature(payload); const response = await fetch(getApiEndpoint(), { method: 'POST', headers: { 'Content-Type': 'application/json', 'User-Agent': `seerxo/${clientVersion}`, 'X-MCP-Signature': signature, 'X-MCP-Timestamp': timestamp.toString(), 'X-MCP-Version': clientVersion, 'X-MCP-API-Key': apiKeyHeader, }, body: JSON.stringify(payload), }); if (!response.ok) { const error = await response.json().catch(() => ({})); throw new Error( error.error || error.message || `API error: ${response.status}` ); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'Content generation failed'); } return { ...data.data, usage: data.usage, }; } catch (error) { throw new Error(error.message || 'Failed to generate Etsy SEO content'); } }
- mcp-server.js:832-845 (schema)Input schema for the tool defining required 'product_name' (string) and optional 'category' (string).inputSchema: { type: 'object', properties: { product_name: { type: 'string', description: 'Name of the product to optimize.', }, category: { type: 'string', description: 'Optional category (e.g., "Home & Living")', }, }, required: ['product_name'], },
- mcp-server.js:823-851 (registration)Registration of the tool in the MCP 'tools/list' RPC method response, including name, description, and input schema.} else if (request.method === 'tools/list') { const response = { jsonrpc: '2.0', id: request.id, result: { tools: [ { name: 'generate_etsy_seo', description: 'Generate SEO-optimized Etsy product listings.', inputSchema: { type: 'object', properties: { product_name: { type: 'string', description: 'Name of the product to optimize.', }, category: { type: 'string', description: 'Optional category (e.g., "Home & Living")', }, }, required: ['product_name'], }, }, ], }, }; console.log(JSON.stringify(response));
- mcp-server.js:852-883 (registration)MCP 'tools/call' handler that checks the tool name 'generate_etsy_seo', invokes the handler, formats the result as rich text content with usage info, and responds.} else if (request.method === 'tools/call') { const { name, arguments: toolArgs } = request.params; if (name === 'generate_etsy_seo') { const result = await generateEtsySEO( toolArgs.product_name, toolArgs.category || '' ); const usageInfo = result.usage ? `\n\n---\n**Usage:** ${result.usage.current}/${result.usage.limit} generations used (${result.usage.remaining} remaining)` : ''; const response = { jsonrpc: '2.0', id: request.id, result: { content: [ { type: 'text', text: `# Etsy SEO Results for "${toolArgs.product_name}"\n\n## 📝 SEO Title\n${result.title}\n\n## 📄 Product Description\n${result.description}\n\n## 🏷️ Tags (15)\n${result.tags.join( ', ' )}\n\n## 💰 Suggested Price\n${ result.suggested_price_range }${usageInfo}`, }, ], }, }; console.log(JSON.stringify(response)); } else {
- mcp-server.js:412-420 (helper)Helper function that generates the HMAC-SHA256 signature and timestamp for authenticating API requests using the API key secret.function generateSignature(payload) { const timestamp = Date.now().toString(); const message = JSON.stringify(payload) + timestamp; const signature = crypto .createHmac('sha256', apiKeySecret || '') .update(message) .digest('hex'); return { signature, timestamp }; }