Skip to main content
Glama
misanthropic-ai

DuckDuckGo MCP Server

ddg-video-search

Search for videos using DuckDuckGo with options to filter by region, safe search, time limit, resolution, duration, license type, and result count.

Instructions

Search for videos using DuckDuckGo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordsYesSearch query keywords
regionNoRegion code (e.g., wt-wt, us-en, uk-en)wt-wt
safesearchNoSafe search levelmoderate
timelimitNoTime limit (d=day, w=week, m=month)
resolutionNoVideo resolution
durationNoVideo duration
license_videosNoVideo license type
max_resultsNoMaximum number of results to return

Implementation Reference

  • The handler function block within handle_call_tool that executes the ddg-video-search logic: parses arguments, performs video search using DDGS().videos(), formats results as numbered list with title, publisher, duration, URL, published date, description, and returns as TextContent.
    elif name == "ddg-video-search": keywords = arguments.get("keywords") if not keywords: raise ValueError("Missing keywords") region = arguments.get("region", "wt-wt") safesearch = arguments.get("safesearch", "moderate") timelimit = arguments.get("timelimit") resolution = arguments.get("resolution") duration = arguments.get("duration") license_videos = arguments.get("license_videos") max_results = arguments.get("max_results", 10) # Perform search ddgs = DDGS() results = ddgs.videos( keywords=keywords, region=region, safesearch=safesearch, timelimit=timelimit, resolution=resolution, duration=duration, license_videos=license_videos, max_results=max_results ) # Format results formatted_results = f"Video search results for '{keywords}':\n\n" for i, result in enumerate(results, 1): formatted_results += ( f"{i}. {result.get('title', 'No title')}\n" f" Publisher: {result.get('publisher', 'Unknown')}\n" f" Duration: {result.get('duration', 'Unknown')}\n" f" URL: {result.get('content', 'No URL')}\n" f" Published: {result.get('published', 'No date')}\n" f" {result.get('description', 'No description')}\n\n" ) return [ types.TextContent( type="text", text=formatted_results, ) ]
  • Registration of the ddg-video-search tool in the list_tools() handler, including the tool name, description, and JSON schema for input validation with required 'keywords' and optional parameters like region, safesearch, etc.
    types.Tool( name="ddg-video-search", description="Search for videos using DuckDuckGo", inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Search query keywords"}, "region": {"type": "string", "description": "Region code (e.g., wt-wt, us-en, uk-en)", "default": "wt-wt"}, "safesearch": {"type": "string", "enum": ["on", "moderate", "off"], "description": "Safe search level", "default": "moderate"}, "timelimit": {"type": "string", "enum": ["d", "w", "m"], "description": "Time limit (d=day, w=week, m=month)"}, "resolution": {"type": "string", "enum": ["high", "standard"], "description": "Video resolution"}, "duration": {"type": "string", "enum": ["short", "medium", "long"], "description": "Video duration"}, "license_videos": {"type": "string", "enum": ["creativeCommon", "youtube"], "description": "Video license type"}, "max_results": {"type": "integer", "description": "Maximum number of results to return", "default": 10}, }, "required": ["keywords"], }, ),
  • Input schema (JSON Schema) for the ddg-video-search tool defining properties and requirements for arguments passed to the handler.
    inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Search query keywords"}, "region": {"type": "string", "description": "Region code (e.g., wt-wt, us-en, uk-en)", "default": "wt-wt"}, "safesearch": {"type": "string", "enum": ["on", "moderate", "off"], "description": "Safe search level", "default": "moderate"}, "timelimit": {"type": "string", "enum": ["d", "w", "m"], "description": "Time limit (d=day, w=week, m=month)"}, "resolution": {"type": "string", "enum": ["high", "standard"], "description": "Video resolution"}, "duration": {"type": "string", "enum": ["short", "medium", "long"], "description": "Video duration"}, "license_videos": {"type": "string", "enum": ["creativeCommon", "youtube"], "description": "Video license type"}, "max_results": {"type": "integer", "description": "Maximum number of results to return", "default": 10}, }, "required": ["keywords"], },

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/misanthropic-ai/ddg-mcp'

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