Skip to main content
Glama
metehan777

Semrush MCP Server

by metehan777

related_keywords

Discover keyword variations and suggestions to expand SEO research based on a seed phrase.

Instructions

Get related keywords and suggestions for a seed keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phraseYes
databaseNo
limitNo

Implementation Reference

  • The handler logic for 'related_keywords' tool: parses input arguments using the schema, calls Semrush API with 'phrase_related' report type and specific parameters/export_columns, and assigns the result to 'data' for further processing.
    case 'related_keywords': {
      const { phrase, database, limit } = RelatedKeywordsSchema.parse(args);
      data = await callSemrushAPI('phrase_related', {
        phrase,
        database,
        display_limit: limit,
        export_columns: 'Ph,Nq,Cp,Co,Nr,Td,Rr',
      });
      break;
    }
  • Zod schema defining the input parameters for the 'related_keywords' tool: phrase (required string), database (optional string, default 'us'), limit (optional number, default 10).
    const RelatedKeywordsSchema = z.object({
      phrase: z.string().describe('Seed keyword phrase'),
      database: z.string().default('us').describe('Database code'),
      limit: z.coerce.number().default(10).describe('Number of results'),
    });
  • src/index.ts:228-236 (registration)
    Tool registration in the list of available tools: specifies name 'related_keywords', description, and inputSchema based on RelatedKeywordsSchema.
    {
      name: 'related_keywords',
      description: 'Get related keywords and suggestions for a seed keyword',
      inputSchema: {
        type: 'object',
        properties: RelatedKeywordsSchema.shape,
        required: ['phrase'],
      },
    },

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/metehan777/semrush-mcp'

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