Skip to main content
Glama

Open Trivia DB — Category Question Count

opentdb.trivia.category_count
Read-onlyIdempotent

Get the number of verified trivia questions available in a specific category, broken down by difficulty (easy, medium, hard). Useful for checking availability before requesting questions with opentdb.trivia.questions — if you request more questions than exist in a filtered query, the API returns empty results. Example: category 9 (General Knowledge) has ~469 verified questions. Source: opentdb.com — CC BY-SA 4.0, free unlimited.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_idYesCategory ID (9–32). Use opentdb.trivia.categories to list all IDs. Examples: 9=General Knowledge, 17=Science & Nature, 21=Sports, 23=History.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint: false. The description adds value beyond annotations by stating the breakdown by difficulty, that counts are 'verified', and warning about empty results for over-requesting. It does not contradict any annotation.

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 three sentences: purpose, usage guidance, and an illustrative example with source attribution. It is front-loaded with the core function, every sentence adds value, and it is appropriately concise without unnecessary verbosity.

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 one parameter fully documented in the schema, safety annotations provided, and an output schema present, the description covers the essential context: when to use, example values, the pitfall of empty results, and even licensing data. Nothing critical is missing for an agent to invoke this tool correctly.

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 description coverage is 100%, so the schema fully documents the category_id parameter with examples and range. The description does not add significant new parameter information beyond confirming the parameter's role, so baseline 3 is appropriate.

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 clearly states the tool's function: get the number of verified trivia questions in a specific category, broken down by difficulty. It is distinct from siblings like opentdb.trivia.questions (fetch questions) and opentdb.trivia.global_count (total count), and the mention of checking availability before requesting questions further differentiates it.

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?

The description explicitly tells when to use this tool: 'before requesting questions with opentdb.trivia.questions', and explains the consequence of over-requesting (empty results). It names the specific sibling tool that benefits from this check. It does not mention other alternatives like global_count or categories, but the context is clear enough.

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.