Skip to main content
Glama
tomek7667

mcp-ctftime

by tomek7667

ctftime_top_by_country

Retrieve top CTF teams of the current year for a given country code.

Instructions

Get top teams for the current year by country (ISO 3166-1 alpha-2 country code, lowercase).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
country_codeYesCountry code (e.g., 'pl', 'us', 'de').

Implementation Reference

  • src/index.ts:146-167 (registration)
    Registration and handler for the ctftime_top_by_country tool. Takes a 2-letter ISO 3166-1 alpha-2 country code and fetches top teams for that country from the CTFtime API endpoint /api/v1/top-by-country/{code}/.
    server.registerTool(
    	"ctftime_top_by_country",
    	{
    		description:
    			"Get top teams for the current year by country (ISO 3166-1 alpha-2 country code, lowercase).",
    		inputSchema: {
    			country_code: z
    				.string()
    				.min(2)
    				.max(2)
    				.describe("Country code (e.g., 'pl', 'us', 'de')."),
    		},
    	},
    	async ({ country_code }) => {
    		const code = country_code.toLowerCase();
    		const url = `${CTFtime_API_BASE}/top-by-country/${code}/`;
    		const data = await getJson<any[]>(url);
    		return {
    			content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
    		};
    	}
    );
  • Input schema for ctftime_top_by_country. Expects a single required string parameter 'country_code' with length exactly 2 (ISO 3166-1 alpha-2 format).
    inputSchema: {
    	country_code: z
    		.string()
    		.min(2)
    		.max(2)
    		.describe("Country code (e.g., 'pl', 'us', 'de')."),
    },
  • Handler function for ctftime_top_by_country. Normalizes the country code to lowercase, fetches top teams from the CTFtime API's top-by-country endpoint, and returns the JSON result as text content.
    async ({ country_code }) => {
    	const code = country_code.toLowerCase();
    	const url = `${CTFtime_API_BASE}/top-by-country/${code}/`;
    	const data = await getJson<any[]>(url);
    	return {
    		content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
    	};
    }
Behavior3/5

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

With no annotations, the description carries the burden. It discloses that results are for the current year but omits behavioral traits like authentication, rate limits, or error handling. Adequate but minimal.

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?

Single sentence with no extraneous words. Every part is necessary and informative.

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

Completeness4/5

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

For a simple one-parameter tool with no output schema, the description covers the core purpose and parameter format. It does not mention return structure, but given the straightforward nature, it is reasonably complete.

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 already describes country_code with min/max length, but the description adds critical format details ('ISO 3166-1 alpha-2, lowercase'), providing value beyond the schema.

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 action (Get top teams), resource (by country), and specific constraints (current year, ISO 3166-1 alpha-2 lowercase). It distinguishes from siblings like ctftime_top_teams by adding the country filter.

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 top teams of a specific country but offers no guidance on when to use this tool versus alternatives like ctftime_top_teams or ctftime_team. No explicit when/not-to-use context.

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