ddg-ai-chat
Query DuckDuckGo's AI models to get answers, explanations, or assistance with questions using various language models.
Instructions
Chat with DuckDuckGo AI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keywords | Yes | Message or question to send to the AI | |
| model | No | AI model to use | gpt-4o-mini |
Implementation Reference
- src/ddg_mcp/server.py:368-387 (handler)Handler for 'ddg-ai-chat' tool: extracts keywords and model from arguments, calls DDGS().chat(), and returns the response as TextContent.elif name == "ddg-ai-chat": keywords = arguments.get("keywords") if not keywords: raise ValueError("Missing keywords") model = arguments.get("model", "gpt-4o-mini") # Perform AI chat ddgs = DDGS() result = ddgs.chat( keywords=keywords, model=model ) return [ types.TextContent( type="text", text=f"DuckDuckGo AI ({model}) response:\n\n{result}", ) ]
- src/ddg_mcp/server.py:164-171 (schema)JSON Schema for input validation of 'ddg-ai-chat' tool: requires 'keywords', optional 'model' with specific enums.inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Message or question to send to the AI"}, "model": {"type": "string", "enum": ["gpt-4o-mini", "llama-3.3-70b", "claude-3-haiku", "o3-mini", "mistral-small-3"], "description": "AI model to use", "default": "gpt-4o-mini"}, }, "required": ["keywords"], },
- src/ddg_mcp/server.py:161-172 (registration)Registration of the 'ddg-ai-chat' tool in the @server.list_tools() handler, defining name, description, and schema.types.Tool( name="ddg-ai-chat", description="Chat with DuckDuckGo AI", inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Message or question to send to the AI"}, "model": {"type": "string", "enum": ["gpt-4o-mini", "llama-3.3-70b", "claude-3-haiku", "o3-mini", "mistral-small-3"], "description": "AI model to use", "default": "gpt-4o-mini"}, }, "required": ["keywords"], }, ),