Skip to main content
Glama

get_years

Read-onlyIdempotent

Retrieve season summary statistics across multiple FRC years to analyze trends in EPA percentiles, scoring averages, foul/RP rates, and counts. Sort and paginate results for time series analysis.

Instructions

List Statbotics season summary statistics across multiple FIRST Robotics Competition (FRC) years in a single call. Returns the same per-season aggregates as get_year (EPA percentiles, scoring averages, foul/RP rates, counts) but as an array, with optional sorting and pagination. Use this to chart trends over time, e.g. "how have average match scores evolved from 2002 to today?", "which seasons had the highest top-1% EPA?", or to dump the full season catalog for downstream analysis. Sort with metric (any returned column name, e.g. epa_max, score_mean) and ascending; paginate with limit (1-1000, default 1000) and offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricNoHow to sort the returned values. Any column in the table is valid.
ascendingNoWhether to sort in ascending order. Default is ascending.
limitNoMaximum number of results to return (1-1000). Default is 1000.
offsetNoOffset from the first result to return.

Implementation Reference

  • The handler for the 'get_years' tool. It parses input using GetYearsInputSchema, builds a query string with optional metric/ascending/limit/offset parameters, and makes a GET request to /v3/years on the Statbotics API.
    case 'get_years': {
      const { metric, ascending, limit, offset } =
        GetYearsInputSchema.parse(args);
      const qs = buildQueryString({ metric, ascending, limit, offset });
      const data = await makeApiRequest(`/v3/years${qs}`);
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
  • Zod schema for the 'get_years' input. Accepts optional metric (sort column), ascending (sort direction), limit (1-1000), and offset (pagination).
    export const GetYearsInputSchema = z.object({
      ...PaginationSortFields,
    });
  • src/tools.ts:49-64 (registration)
    Registration of the 'get_years' tool in the tools array. Defines name, description, readOnly annotations, and inputSchema derived from GetYearsInputSchema.
    {
      name: 'get_years',
      description:
        'List Statbotics season summary statistics across multiple FIRST Robotics Competition (FRC) years in a single call. ' +
        'Returns the same per-season aggregates as get_year (EPA percentiles, scoring averages, foul/RP rates, counts) ' +
        'but as an array, with optional sorting and pagination. ' +
        'Use this to chart trends over time, e.g. "how have average match scores evolved from 2002 to today?", ' +
        '"which seasons had the highest top-1% EPA?", or to dump the full season catalog for downstream analysis. ' +
        'Sort with `metric` (any returned column name, e.g. `epa_max`, `score_mean`) and `ascending`; ' +
        'paginate with `limit` (1-1000, default 1000) and `offset`.',
      annotations: {
        title: 'List FRC Season Statistics (Multiple Years)',
        ...readOnlyAnnotations,
      },
      inputSchema: toMCPSchema(GetYearsInputSchema),
    },
  • The makeApiRequest helper used by the get_years handler to make HTTP GET requests to the Statbotics API.
    export async function makeApiRequest(endpoint: string): Promise<unknown> {
      try {
        const url = `https://api.statbotics.io${endpoint}`;
    
        const response = await fetch(url, {
          headers: {
            Accept: 'application/json',
          },
        });
    
        if (!response.ok) {
          const errorMessage = `Statbotics API request failed: ${response.status} ${response.statusText} for endpoint ${endpoint}`;
          await log('error', errorMessage);
          throw new Error(errorMessage);
        }
    
        return response.json();
      } catch (error) {
        if (error instanceof Error) {
          const errorMessage = `API request error for endpoint ${endpoint}: ${error.message}`;
          await log('error', errorMessage);
          throw error;
        }
        const errorMessage = `Unknown error during API request for endpoint ${endpoint}`;
        await log('error', `${errorMessage}: ${error}`);
        throw new Error(errorMessage);
      }
    }
Behavior4/5

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

Annotations already provide readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. The description adds that the tool returns an array with the same aggregates as get_year, and explains sorting/pagination behavior. This provides additional useful context beyond annotations.

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 concise, with a clear first sentence stating purpose and return type, and a second sentence providing usage examples and parameter details. No fluff, every sentence adds value.

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?

Despite missing output schema, the description explains the return type (array of per-season aggregates like get_year) and covers sorting, pagination, and use cases. It is comprehensive for a list tool of moderate complexity.

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?

Schema descriptions cover 100% of parameters. The description adds examples for metric (e.g., epa_max, score_mean), clarifies ascending defaults, and provides default values for limit (1000) and offset (0). This adds meaning 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 it lists season summary statistics across multiple FRC years, specifying it returns an array of per-season aggregates similar to get_year. It distinguishes itself from get_year (single year) by explicitly mentioning the array format and optional sorting/pagination.

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 provides explicit use cases such as charting trends over time and dumping the full season catalog. It implies when to use (multiple years) but does not explicitly state when not to use or name alternatives like get_year for single year. However, the context is clear.

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/withinfocus/statbotics-mcp-server'

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