Skip to main content
Glama
tomek7667

mcp-ctftime

by tomek7667

ctftime_results

Retrieve CTF competition event results by year. Defaults to the current year if no year provided.

Instructions

Get event results for a year (or current year if omitted).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoYear (e.g., 2025).

Implementation Reference

  • src/index.ts:186-209 (registration)
    Registration of the 'ctftime_results' tool with description and input schema.
    server.registerTool(
    	"ctftime_results",
    	{
    		description: "Get event results for a year (or current year if omitted).",
    		inputSchema: {
    			year: z
    				.number()
    				.int()
    				.min(2011)
    				.max(2100)
    				.optional()
    				.describe("Year (e.g., 2025)."),
    		},
    	},
    	async ({ year }) => {
    		const url = year
    			? `${CTFtime_API_BASE}/results/${year}/`
    			: `${CTFtime_API_BASE}/results/`;
    		const data = await getJson<any>(url);
    		return {
    			content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
    		};
    	}
    );
  • Input schema for 'ctftime_results': optional year (integer, 2011-2100).
    {
    	description: "Get event results for a year (or current year if omitted).",
    	inputSchema: {
    		year: z
    			.number()
    			.int()
    			.min(2011)
    			.max(2100)
    			.optional()
    			.describe("Year (e.g., 2025)."),
    	},
  • Handler function that calls CTFtime API /results/ endpoint with optional year, returns JSON result.
    	async ({ year }) => {
    		const url = year
    			? `${CTFtime_API_BASE}/results/${year}/`
    			: `${CTFtime_API_BASE}/results/`;
    		const data = await getJson<any>(url);
    		return {
    			content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
    		};
    	}
    );
  • Generic helper getJson<T> used by the handler to fetch and parse JSON from CTFtime API.
    async function getJson<T>(url: string): Promise<T> {
    	const res = await fetch(url, {
    		headers: {
    			Accept: "application/json",
    			// CTFtime doesn't require a UA header for this API, but it helps with debugging and etiquette.
    			"User-Agent": "mcp-ctftime/0.1.0 (+https://ctftime.org/api/)",
    		},
    	});
    	if (!res.ok) {
    		const text = await res.text().catch(() => "");
    		throw new Error(
    			`CTFtime API error ${res.status} for ${url}${
    				text ? `: ${text.slice(0, 300)}` : ""
    			}`
    		);
    	}
    	return (await res.json()) as T;
    }
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral traits such as result format, pagination, ordering, or any side effects. The description is too brief to cover necessary behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, efficient and front-loaded. It earns its place but could benefit from slight expansion on output to improve completeness.

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 no output schema, the description fails to explain what 'event results' actually contain—whether it's scores, rankings, or event details. This lack of completeness hinders proper tool selection and invocation.

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

Parameters4/5

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

The schema describes the year parameter with type and bounds, and the description adds that omitting it uses the current year. This adds practical meaning beyond the schema, which had no default hint.

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 gets event results for a year, with the default being the current year. This distinguishes it from siblings like ctftime_event (single event) and ctftime_events (list events).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving results by year or defaulting to current, but does not provide explicit guidance on when to use this tool versus alternatives like ctftime_top_teams or ctftime_votes.

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/tomek7667/mcp-ctftime'

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