Skip to main content
Glama
umbra2728

CTFd MCP Server

list_challenges

List visible challenges from a CTFd platform, with optional filters to narrow by category or show only unsolved ones, helping you quickly find relevant tasks.

Instructions

List visible challenges. Optional filter by category and unsolved only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNo
only_unsolvedNo

Implementation Reference

  • MCP tool handler function that exposes list_challenges as a FastMCP tool. It delegates to CTFdClient.list_challenges() and formats errors.
    @mcp.tool(
        description="List visible challenges. Optional filter by category and unsolved only."
    )
    async def list_challenges(category: str | None = None, only_unsolved: bool = False):
        client = await _get_client()
        try:
            return await client.list_challenges(
                category=category, only_unsolved=only_unsolved
            )
        except Exception as exc:  # noqa: BLE001 - map to user-friendly MCP error
            raise _format_error(exc)
  • The @mcp.tool decorator registers list_challenges as an MCP tool with description metadata.
    @mcp.tool(
        description="List visible challenges. Optional filter by category and unsolved only."
    )
  • The client-side implementation that fetches challenges from the CTFd API (/api/v1/challenges), filters by category (case-insensitive) and solve state, then normalizes the response into a list of dicts with id, name, category, value, solved, type, tags.
    async def list_challenges(
        self, category: str | None = None, only_unsolved: bool = False
    ) -> list[dict[str, Any]]:
        """List challenges the user can see, optionally filtered by category and solve state."""
        payload = await self._request("GET", "/api/v1/challenges")
        challenges = payload.get("data") or []
    
        normalized = []
        for item in challenges:
            if category and (item.get("category") or "").lower() != category.lower():
                continue
    
            solved = item.get("solved")
            if solved is None:
                solved = item.get("solved_by_me")
            if only_unsolved and solved:
                continue
    
            normalized.append(
                {
                    "id": item.get("id"),
                    "name": item.get("name"),
                    "category": item.get("category"),
                    "value": item.get("value"),
                    "solved": solved if solved is not None else item.get("solved"),
                    "type": item.get("type"),
                    "tags": item.get("tags") or [],
                }
            )
        return normalized
Behavior2/5

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

No annotations provided. Description implies read-only but lacks details on authentication, rate limits, or other behavioral traits beyond listing.

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?

One sentence front-loaded with purpose, followed by optional filters. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks output schema or description of return structure (e.g., array of challenge objects, pagination). Adequate for a simple list but leaves ambiguity for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no param descriptions). The description mentions optional filtering by category and unsolved status but does not clarify valid category values or the precise meaning of 'unsolved only' (e.g., user-specific unsolved).

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 lists visible challenges with optional filters, distinguishing it from siblings like challenge_details or submit_flag.

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?

No explicit guidance on when to use this tool versus alternatives such as challenge_details for individual challenge details or submit_flag for flag submission.

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/umbra2728/ctfd-mcp'

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