ctftime_votes
Retrieve event votes for a specified year from CTFtime. Input the year to obtain the vote records.
Instructions
Get event votes for a year.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | Year (e.g., 2025). |
Implementation Reference
- src/index.ts:211-226 (registration)Registration of the 'ctftime_votes' tool with the MCP server using server.registerTool()
server.registerTool( "ctftime_votes", { description: "Get event votes for a year.", inputSchema: { year: z.number().int().min(2011).max(2100).describe("Year (e.g., 2025)."), }, }, async ({ year }) => { const url = `${CTFtime_API_BASE}/votes/${year}/`; const data = await getJson<any>(url); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; } ); - src/index.ts:213-217 (schema)Input schema defining the required 'year' parameter (z.number().int().min(2011).max(2100))
{ description: "Get event votes for a year.", inputSchema: { year: z.number().int().min(2011).max(2100).describe("Year (e.g., 2025)."), }, - src/index.ts:219-225 (handler)Handler function that fetches event votes from CTFtime API for the given year and returns JSON text content
async ({ year }) => { const url = `${CTFtime_API_BASE}/votes/${year}/`; const data = await getJson<any>(url); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], }; }