Skip to main content
Glama
fetchSERP

FetchSERP MCP Server

Official
by fetchSERP

generate_social_content

Create customized social media content using AI by inputting user and system prompts, and selecting preferred AI models on the FetchSERP MCP Server.

Instructions

Generate social media content using AI with customizable prompts and models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ai_modelNoThe AI model (default: gpt-4.1-nano)gpt-4.1-nano
system_promptYesThe system prompt
user_promptYesThe user prompt

Implementation Reference

  • The specific case handler in the handleToolCall switch statement that proxies the tool call to the external FetchSERP API endpoint '/api/v1/generate_social_content' using the shared makeRequest method.
    case 'generate_social_content':
      return await this.makeRequest('/api/v1/generate_social_content', 'GET', args, null, token);
  • Input schema for the generate_social_content tool, defining required user_prompt and system_prompt strings, and optional ai_model.
    inputSchema: {
      type: 'object',
      properties: {
        user_prompt: {
          type: 'string',
          description: 'The user prompt',
        },
        system_prompt: {
          type: 'string',
          description: 'The system prompt',
        },
        ai_model: {
          type: 'string',
          description: 'The AI model (default: gpt-4.1-nano)',
          default: 'gpt-4.1-nano',
        },
      },
      required: ['user_prompt', 'system_prompt'],
    },
  • index.js:485-507 (registration)
    Tool registration entry in the ListTools response, including name, description, and input schema.
    {
      name: 'generate_social_content',
      description: 'Generate social media content using AI with customizable prompts and models',
      inputSchema: {
        type: 'object',
        properties: {
          user_prompt: {
            type: 'string',
            description: 'The user prompt',
          },
          system_prompt: {
            type: 'string',
            description: 'The system prompt',
          },
          ai_model: {
            type: 'string',
            description: 'The AI model (default: gpt-4.1-nano)',
            default: 'gpt-4.1-nano',
          },
        },
        required: ['user_prompt', 'system_prompt'],
      },
    },
  • Shared helper method used by all tool handlers to make authenticated HTTP requests to the FetchSERP API backend, handling token, params, errors, and JSON parsing.
    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?

With no annotations provided, the description carries full burden but only mentions AI usage and customizability. It lacks critical behavioral details: whether this creates new content (likely yes, but not stated), rate limits, authentication needs, output format, or any side effects. The description is insufficient for a mutation tool with zero annotation coverage.

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

Conciseness4/5

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

Single sentence that is efficient and front-loaded with the core purpose. No wasted words, though it could be slightly more structured by separating usage context from technical details.

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

Completeness2/5

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

For a content generation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., generated text, format, length), error conditions, or important behavioral constraints. The description should compensate for missing structured data but fails to do so adequately.

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?

Schema description coverage is 100%, so the schema already documents all three parameters with clear descriptions. The description adds no additional parameter meaning beyond implying these are for AI customization, which is already evident from parameter names and schema descriptions. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'generate' and resource 'social media content', specifying it uses AI with customizable prompts and models. It distinguishes from most siblings focused on SEO/analysis/scraping, though not explicitly from 'generate_wordpress_content' which is similar but for a different content type.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like 'generate_wordpress_content' or other content creation methods. The description implies usage for social media content generation but doesn't specify scenarios, prerequisites, or exclusions.

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