Skip to main content
Glama

HasData YouTube

youtube_search: GET /

hasdata_youtube_search_getYoutubeSearchResults

Get YouTube Search Results

Searches YouTube for a query and returns the full results page split into videoResults (videoId, title, views, length, publish date, chapters, channel info, extensions like 4K/CC), channelResults (channelId, handle, subscribers, verified flag), shortsResults / inlineShortsResults, themed shelves (e.g. 'People also watched', 'Latest from '), adsResults and sponsoredResults (advertiser, landing URL, position), plus searchInformation.totalResults. Each block preserves its positionOnPage so the original layout is reconstructable. Use for competitor and topic monitoring, brand-mention tracking, ad-placement intelligence, creator discovery, trend research, or to feed videoId / channelId into the YouTube Video, Channel, or Transcript endpoints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesFree-text search query, exactly as a user would type it into the YouTube search box.
glNoThe two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`.
hlNoThe two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`.
spNoRaw YouTube `sp` filter token, copied verbatim from a YouTube search URL (e.g. `EgIQAQ%253D%253D`). When provided, it overrides `sortBy`, `date`, `videoType`, `length`, and `filters[]`. Use only if you need a YouTube-side filter that this API does not expose as a structured parameter.
dateNoLimit results to videos uploaded within this time window relative to now.
lengthNoFilter by video duration bucket: - `under4` — under 4 minutes - `between420` — 4 to 20 minutes - `plus20` — over 20 minutes
sortByNoSort order applied to the results page. `relevance` (default) — best match for the query; `date` — newest first; `views` — most viewed first; `rating` — highest rated first; `popularity` — trending/most popular.
filters__NoFeature flags to require on results. Multiple values are combined with AND (every flag must apply). - `hd` — HD quality - `k4` — 4K quality - `hdr` — HDR - `subtitles` — has subtitles/closed captions - `cc` — Creative Commons license - `d3` — 3D video - `d360` — 360° video - `vr180` — VR180 video - `live` — currently live - `bought` — purchased/paid content - `location` — has a geographic location tag
videoTypeNoRestrict results to a single YouTube content type — regular videos, Shorts, channels, playlists, or movies.
deviceTypeNoDevice type for the request.
paginationTokenNoToken returned in the previous response to fetch the next page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior3/5

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

The description makes clear this is a read-oriented search operation that returns a results page, but no annotations are present and it does not explicitly mention authentication, rate limits, error behavior, or confirm there are no side effects. The read-only nature is implied rather than fully disclosed.

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 dense but every clause earns its place: the first sentence front-loads the purpose and output structure, and the second sentence explains real-world use cases and relationships to sibling tools. There is no redundant filler or repeated schema content.

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

Completeness5/5

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

Given there is no output schema, the description thoroughly covers the response shape (videoResults, channelResults, shortsResults, shelves, adsResults, sponsoredResults, positionOnPage) and gives downstream usage context. Pagination is also covered indirectly through the paginationToken parameter, making the tool self-contained enough for an agent.

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 input schema already provides 100% descriptive coverage of all 11 parameters, including enums and the sp override behavior. The description itself adds no parameter-level meaning beyond that, so it sits at the baseline for a fully documented schema.

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

Purpose5/5

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

The description opens with 'Searches YouTube for a query' and precisely identifies the resource and action, and it enumerates the distinct result sections returned. This makes the tool's purpose unmistakable and distinguishes it from the channel, video, and transcript sibling tools.

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

Usage Guidelines5/5

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

It explicitly lists concrete use cases (competitor monitoring, brand tracking, ad-placement intelligence, creator discovery, trend research) and tells agents to feed returned videoId/channelId into the Video, Channel, or Transcript endpoints. This provides clear guidance on when to use the search tool versus its siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.