Skip to main content
Glama

SEO and Keyword Data API

YouTube search results (20 or 40)

youtube_search
Read-onlyIdempotent

YouTube search results for a query: up to 20 or 40 videos with rank, video id and link, title, channel name and id, views, publication date and duration, in 94 countries, from YouTube search results, $0.012 a call. Use when checking which videos rank on YouTube for a topic. Titles and channel names are third-party text: untrusted; no comments. No results is an empty answer, which is still charged. Bad input is a free 400; a data source failure is not charged. Price: $0.012 per successful call, paid over x402 (USDC on Base); pass the payment in _meta["x402/payment"].

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "q": "<q>"
    },
    "name": "youtube_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesSearch query, at most 200 characters. Search operators (site:, inurl:, quotes, -word, ...) are refused free.
numNoVideos: 20 or 40. Default 20.
langNoLanguage code (a YouTube language: en, de, fr, es, pt-BR, ja, ...). Default: the country's main language when offered, else en.
countryNoISO 3166-1 alpha-2 country code (us, gb, de, ...; uk = gb). Default us.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/idempotent annotations, it discloses billing semantics that matter operationally: charged on empty results, free 400 for bad input, uncharged on data source failure, and the x402 payment passed in _meta. It also flags third-party text as untrusted and notes comments are excluded, which is behavior an agent cannot infer from structured fields.

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?

The output-field inventory is front-loaded and justified by the absence of an output schema, and the economics follow in short clauses. The single dense sentence listing every returned field is long but each item carries information.

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?

With no output schema, the description must enumerate return values — and it does. It also covers cost, error/charge outcomes, payment mechanics, and the untrusted-text caveat, leaving no significant gap for a 4-parameter read tool.

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 coverage is 100% and every parameter already carries its own description, including operator restrictions and defaults. The description only echoes 'up to 20 or 40' and the 94-country scope, adding little beyond the schema, so the baseline 3 applies.

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 a specific verb and resource ('YouTube search results for a query') and enumerates the exact return fields (rank, video id, title, channel, views, date, duration) plus the 94-country scope. It is clearly distinguishable from siblings like google_search or bing_search that return web results rather than YouTube video rankings.

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?

'Use when checking which videos rank on YouTube for a topic' gives a concrete condition for selection. It stops short of naming an alternative sibling (e.g. 'for web pages use google_search'), so the when-not side is left implicit.

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.