@dennisk2025/random-trivia-category-facts
v1.0.0
Published
Fetches a random trivia fact from a specific category such as science, sports, history, or geography using the Open Trivia Database API.
Readme
random-trivia-category-facts
Fetches a random trivia fact from a specific category such as science, sports, history, or geography using the Open Trivia Database API. Great for learning quick, interesting facts by topic.
Installation
Via npx (Recommended, zero-install):
npx @dennisk2025/random-trivia-category-factsOr install globally with npm:
npm install -g @dennisk2025/random-trivia-category-factsThen run:
random-trivia-category-factsAdding to Claude Desktop
Add this to your Claude Desktop config file at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Example config section:
{
"mcpServers": {
"trivia-facts": {
"command": "npx",
"args": ["@dennisk2025/random-trivia-category-facts"]
}
}
}Usage
You can access the following tool in Claude Desktop (or by direct JSON tool invocation):
Tool: get_random_trivia_fact
Returns a random trivia fact from a chosen category. Provides the question, correct answer, and category.
Parameters
category(string, optional): The category of trivia fact to fetch. Example: "Science & Nature", "Sports", "History", "Geography". If not provided, a random supported category is chosen.
Example Calls
Get a random science fact:
{
"tool": "get_random_trivia_fact",
"arguments": {
"category": "Science & Nature"
}
}Get a random fact from a random supported category:
{
"tool": "get_random_trivia_fact",
"arguments": {}
}Supported Categories
- Science & Nature
- Sports
- History
- Geography
Output Format
The result will contain:
question(string): The trivia question.correct_answer(string): The answer.category(string): The trivia category.
Example result:
{
"question": "What is the chemical symbol for Hydrogen?",
"correct_answer": "H",
"category": "Science & Nature"
}Error Handling
If you provide an unsupported category or the API fails, an error message will be returned.
