Skip to main content
Glama
fetchSERP

FetchSERP MCP Server

Official
by fetchSERP

get_keywords_suggestions

Generate relevant keyword suggestions for SEO and content optimization by analyzing a URL or provided keywords. Optimize search performance and strategy with targeted data.

Instructions

Get keyword suggestions based on a url or a list of keywords

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countryNoThe country code to search for
keywordsNoThe keywords to search (optional if url provided)
urlNoThe url to search (optional if keywords provided)

Implementation Reference

  • Handler implementation for the 'get_keywords_suggestions' tool within the handleToolCall method's switch statement. It delegates the execution to the makeRequest helper with the specific API endpoint.
    case 'get_keywords_suggestions':
      return await this.makeRequest('/api/v1/keywords_suggestions', 'GET', args, null, token);
  • Input schema definition for the 'get_keywords_suggestions' tool, specifying parameters like url, keywords, and country.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'The url to search (optional if keywords provided)',
        },
        keywords: {
          type: 'array',
          items: { type: 'string' },
          description: 'The keywords to search (optional if url provided)',
        },
        country: {
          type: 'string',
          description: 'The country code to search for',
        },
      },
  • index.js:135-156 (registration)
    Registration of the 'get_keywords_suggestions' tool in the ListToolsRequestSchema handler's tools array, including name, description, and input schema.
    {
      name: 'get_keywords_suggestions',
      description: 'Get keyword suggestions based on a url or a list of keywords',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'The url to search (optional if keywords provided)',
          },
          keywords: {
            type: 'array',
            items: { type: 'string' },
            description: 'The keywords to search (optional if url provided)',
          },
          country: {
            type: 'string',
            description: 'The country code to search for',
          },
        },
      },
    },
  • Shared helper function 'makeRequest' that handles the actual HTTP API call to FetchSERP endpoints, used by the tool handler.
    async makeRequest(endpoint, method = 'GET', params = {}, body = null, token = null) {
      const fetchserpToken = token || process.env.FETCHSERP_API_TOKEN;
      
      if (!fetchserpToken) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          'FETCHSERP_API_TOKEN is required'
        );
      }
    
      const url = new URL(`${API_BASE_URL}${endpoint}`);
      
      // Add query parameters for GET requests
      if (method === 'GET' && Object.keys(params).length > 0) {
        Object.entries(params).forEach(([key, value]) => {
          if (value !== undefined && value !== null) {
            if (Array.isArray(value)) {
              value.forEach(v => url.searchParams.append(`${key}[]`, v));
            } else {
              url.searchParams.append(key, value.toString());
            }
          }
        });
      }
    
      const fetchOptions = {
        method,
        headers: {
          'Authorization': `Bearer ${fetchserpToken}`,
          'Content-Type': 'application/json',
        },
      };
    
      if (body && method !== 'GET') {
        fetchOptions.body = JSON.stringify(body);
      }
    
      const response = await fetch(url.toString(), fetchOptions);
      
      if (!response.ok) {
        const errorText = await response.text();
        throw new McpError(
          ErrorCode.InternalError,
          `API request failed: ${response.status} ${response.statusText} - ${errorText}`
        );
      }
    
      return await response.json();
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get keyword suggestions', which implies a read-only operation, but doesn't clarify if it requires authentication, has rate limits, returns structured data, or handles errors. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get keyword suggestions based on a url or a list of keywords'. It's front-loaded with the core purpose and includes essential input options without unnecessary details. Every word earns its place, making it highly concise and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and input options but lacks details on behavior, output format, or error handling. Without annotations or an output schema, the description should do more to compensate, but it only meets the minimum viable threshold for understanding what the tool does.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning all parameters are documented in the schema. The description adds minimal value by mentioning 'url or a list of keywords', which aligns with the schema's 'url' and 'keywords' parameters, but doesn't provide additional context like format examples or usage tips. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get keyword suggestions based on a url or a list of keywords'. It specifies the action ('Get keyword suggestions') and the input sources ('url or a list of keywords'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_long_tail_keywords' or 'get_keywords_search_volume', which might offer similar functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning the two input options ('url or a list of keywords'), suggesting it can be used in either scenario. However, it doesn't provide explicit guidance on when to choose this tool over alternatives like 'get_long_tail_keywords' or 'get_keywords_search_volume', nor does it mention any prerequisites or exclusions. The usage context is somewhat implied but not clearly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/fetchSERP/fetchserp-mcp-server-node'

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