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"],
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action ('Search for videos'). It doesn't mention whether this is a read-only operation, potential rate limits, authentication needs, or what the output format looks like (e.g., list of video metadata). For a search tool with 8 parameters, this is a significant gap in transparency.

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 with zero waste: 'Search for videos using DuckDuckGo'. It's front-loaded with the core purpose and appropriately sized for the tool's complexity.

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's moderate complexity (8 parameters, no output schema, no annotations), the description is incomplete. It lacks behavioral context (e.g., read-only nature, result format), usage guidance relative to siblings, and any mention of output structure, making it inadequate for full agent understanding.

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 schema description coverage is 100%, with all parameters well-documented in the input schema (e.g., 'keywords' as search query, 'region' with examples, enums for filters). The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline score of 3 for high schema coverage.

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 tool's purpose as 'Search for videos using DuckDuckGo', which includes a specific verb ('Search') and resource ('videos') with the search engine specified. However, it doesn't explicitly differentiate from sibling tools like ddg-image-search or ddg-text-search beyond the 'videos' keyword, which is why it doesn't reach a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like ddg-image-search or ddg-text-search. There's no mention of specific use cases, prerequisites, or exclusions, leaving the agent with minimal context for tool selection.

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

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