Skip to main content
Glama
rollbar

Rollbar MCP Server

Official
by rollbar

get-top-items

Retrieve the most frequent or critical error items from a Rollbar project to identify and prioritize issues for debugging and monitoring.

Instructions

Get list of top items in the Rollbar project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentNoEnvironment name (default: production)production
projectNoProject name (optional when only one project is configured)

Implementation Reference

  • The handler function that executes the "get-top-items" tool logic by querying the Rollbar API.
    async ({ environment, project }) => {
      const { token, apiBase } = resolveProject(project);
      const reportUrl = `${apiBase}/reports/top_active_items?hours=24&environments=${environment}&sort=occurrences`;
      const reportResponse = await makeRollbarRequest<
        RollbarApiResponse<RollbarTopItemResponse>
      >(reportUrl, "get-top-items", token);
    
      if (reportResponse.err !== 0) {
        const errorMessage =
          reportResponse.message ||
          `Unknown error (code: ${reportResponse.err})`;
        throw new Error(`Rollbar API returned error: ${errorMessage}`);
      }
    
      const topItems = reportResponse.result;
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(topItems),
          },
        ],
      };
    },
  • The registration function for the "get-top-items" tool.
    export function registerGetTopItemsTool(server: McpServer) {
      server.tool(
        "get-top-items",
        "Get list of top items in the Rollbar project",
        {
          environment: z.coerce
            .string()
            .default("production")
            .describe("Environment name (default: production)"),
          project: buildProjectParam(),
        },
        async ({ environment, project }) => {
          const { token, apiBase } = resolveProject(project);
          const reportUrl = `${apiBase}/reports/top_active_items?hours=24&environments=${environment}&sort=occurrences`;
          const reportResponse = await makeRollbarRequest<
            RollbarApiResponse<RollbarTopItemResponse>
          >(reportUrl, "get-top-items", token);
    
          if (reportResponse.err !== 0) {
            const errorMessage =
              reportResponse.message ||
              `Unknown error (code: ${reportResponse.err})`;
            throw new Error(`Rollbar API returned error: ${errorMessage}`);
          }
    
          const topItems = reportResponse.result;
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(topItems),
              },
            ],
          };
        },
      );
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It fails to explain what criteria define 'top' items, whether results are paginated, rate limits, or the structure of returned data. The description only implies a read-only operation through the verb 'Get' but provides no substantive 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 and appropriately front-loaded. However, it prioritizes brevity over clarity—while not verbose, it wastes the single sentence on vague terminology ('top items') rather than precise functional description.

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?

Lacking annotations and output schema, the description should explain the return format and sorting logic. It fails to clarify the critical distinction between 'top items' and regular item listing, and omits operational details like default result limits or time ranges, leaving significant gaps for a 2-parameter tool.

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

Parameters3/5

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

Schema description coverage is 100%, with both 'environment' and 'project' parameters fully documented in the schema. The description adds no parameter-specific guidance, but the baseline score of 3 is appropriate given the schema already carries the semantic load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the basic action ('Get list') and resource ('top items'), but fails to define what 'top' means (frequency? severity? impact?). Given the sibling tool 'list-items', this ambiguity prevents the agent from selecting the correct tool. It restates the tool name with slightly more detail but lacks specificity.

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 guidance provided on when to use this versus the sibling 'list-items' tool, or when the optional 'project' parameter is required. The description lacks any 'when-to-use' or 'when-not-to-use' instructions, leaving the agent to guess the appropriate 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/rollbar/rollbar-mcp-server'

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