Skip to main content
Glama
cortex8

DataForSEO MCP Server

by cortex8

serp_youtube_locations

Retrieve available geographic locations for YouTube SERP data analysis to ensure accurate regional targeting and content performance tracking across organic results, video information, comments, and subtitles.

Instructions

Utility tool to get list of available locations for: serp_youtube_organic_live_advanced, serp_youtube_video_info_live_advanced, serp_youtube_video_comments_live_advanced, serp_youtube_video_subtitles_live_advanced.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
country_iso_codeYesISO 3166-1 alpha-2 country code, for example: US, GB, MT
location_nameNoName of location or it`s part.
location_typeNoType of location. Possible variants: 'TV Region','Postal Code','Neighborhood','Governorate','National Park','Quarter','Canton','Airport','Okrug','Prefecture','City','Country','Province','Barrio','Sub-District','Congressional District','Municipality District','district','DMA Region','Union Territory','Territory','Colloquial Area','Autonomous Community','Borough','County','State','District','City Region','Commune','Region','Department','Division','Sub-Ward','Municipality','University'

Implementation Reference

  • The handle() method executes the tool logic: constructs the request payload from parameters and sends a POST request to the DataForSEO /v3/serp/youtube/locations endpoint, then formats the response.
    async handle(params:any): Promise<any> {
      try {
    
       const payload: Record<string, unknown> = {
          'country_iso_code': params.country_iso_code,
        };
    
        if (params.location_type) {
          payload['location_type'] = params.location_type;
        }
    
        if (params.location_name) {
          payload['location_name'] = params.location_name;
        }
    
        const response = await this.dataForSEOClient.makeRequest(`/v3/serp/youtube/locations`, 'POST', [payload]);
        return this.validateAndFormatResponse(response);
      } catch (error) {
        return this.formatErrorResponse(error);
      }
    }
  • Defines the input schema using Zod for parameters: country_iso_code (required), location_type and location_name (optional).
    getParams(): z.ZodRawShape {
      return {
        country_iso_code: z.string().describe("ISO 3166-1 alpha-2 country code, for example: US, GB, MT"),
        location_type: z.string().optional().describe("Type of location. Possible variants: 'TV Region','Postal Code','Neighborhood','Governorate','National Park','Quarter','Canton','Airport','Okrug','Prefecture','City','Country','Province','Barrio','Sub-District','Congressional District','Municipality District','district','DMA Region','Union Territory','Territory','Colloquial Area','Autonomous Community','Borough','County','State','District','City Region','Commune','Region','Department','Division','Sub-Ward','Municipality','University'"),
        location_name: z.string().optional().describe("Name of location or it`s part.")
      };
    }
  • Instantiates the SerpYoutubeLocationsListTool within the SerpApiModule's getTools() method, adding it to the list of tools that will be registered with their name, description, params, and handler.
    new SerpYoutubeLocationsListTool(this.dataForSEOClient),
  • Returns the tool name 'serp_youtube_locations' used for registration in the module.
    getName(): string {
      return 'serp_youtube_locations';
    }
  • Imports the SerpYoutubeLocationsListTool class from its file for use in the module.
    import { SerpYoutubeLocationsListTool } from './tools/serp-youtube-locations-list.tool.js';
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 offers minimal behavioral disclosure. It doesn't describe what the tool returns (list format, structure), whether it's cached/real-time data, rate limits, authentication needs, or error conditions. The description only states it's a 'utility tool' without explaining operational characteristics.

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 that directly states the tool's purpose and target tools without any wasted words. It's appropriately sized and front-loaded with the core functionality, making it easy for an agent to parse quickly.

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?

Given the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what the returned location data looks like (format, structure, fields), how results are filtered/limited, or any behavioral aspects. For a utility tool that presumably returns structured location data, more context about the output is needed.

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 fully documents all three parameters with their types, descriptions, and requirements. The description adds no parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter semantics.

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

Purpose3/5

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

The description states the tool's purpose as getting 'list of available locations' for specific YouTube SERP tools, which is clear but somewhat vague. It specifies the resource (locations) and target tools, but doesn't articulate the exact verb or differentiate from the sibling 'serp_locations' tool that appears to serve a similar function for non-YouTube SERP tools.

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

Usage Guidelines4/5

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

The description explicitly lists four specific sibling tools for which this location data is intended, providing clear context for when to use it. However, it doesn't mention when NOT to use it (e.g., for non-YouTube SERP tools) or explicitly name alternatives like 'serp_locations' for other SERP tools.

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

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/cortex8/oyt-dataforseo-mcp-worker'

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