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
| Name | Required | Description | Default |
|---|---|---|---|
| phrase | Yes | ||
| database | No | ||
| limit | No |
Implementation Reference
- src/index.ts:312-321 (handler)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; }
- src/index.ts:96-100 (schema)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'], }, },