Skip to main content
Glama
rollbar

Rollbar MCP Server

Official
by rollbar

get-item-details

Retrieve detailed information about specific error items in Rollbar for troubleshooting and monitoring purposes.

Instructions

Get item details for a Rollbar item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
counterYesRollbar item counter
max_tokensNoMaximum tokens for occurrence data in response (default: 20000). Occurrence response will be truncated if it exceeds this limit.
projectNoProject name (optional when only one project is configured)

Implementation Reference

  • The async handler function for the get-item-details tool, which fetches item details from the Rollbar API using a counter and occurrence ID, processes the response, and truncates the data.
    async ({ counter, max_tokens, project }) => {
      const { token, apiBase } = resolveProject(project);
      // Redirects are followed, so we get an item response from the counter request
      const counterUrl = `${apiBase}/item_by_counter/${counter}`;
      const itemResponse = await makeRollbarRequest<
        RollbarApiResponse<RollbarItemResponse>
      >(counterUrl, "get-item-details", token);
    
      if (itemResponse.err !== 0) {
        const errorMessage =
          itemResponse.message || `Unknown error (code: ${itemResponse.err})`;
        throw new Error(`Rollbar API returned error: ${errorMessage}`);
      }
    
      const item = itemResponse.result;
    
      const occurrenceUrl = `${apiBase}/instance/${item.last_occurrence_id}`;
      const occurrenceResponse = await makeRollbarRequest<
        RollbarApiResponse<RollbarOccurrenceResponse>
      >(occurrenceUrl, "get-item-details", token);
    
      if (occurrenceResponse.err !== 0) {
        // We got the item but failed to get occurrence. Return just the item data.
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(item),
            },
          ],
        };
      }
    
      const occurrence = occurrenceResponse.result;
    
      // Remove the metadata section from occurrence.data
      if (occurrence.data && occurrence.data.metadata) {
        delete occurrence.data.metadata;
      }
    
      // Combine item and occurrence data
      const responseData = {
        ...item,
        occurrence: truncateOccurrence(occurrence, max_tokens),
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(responseData),
          },
        ],
      };
    },
  • The Zod schema definition for the get-item-details tool inputs (counter, max_tokens, project).
    {
      counter: z.number().int().describe("Rollbar item counter"),
      max_tokens: z
        .number()
        .int()
        .optional()
        .default(20000)
        .describe(
          "Maximum tokens for occurrence data in response (default: 20000). Occurrence response will be truncated if it exceeds this limit.",
        ),
      project: buildProjectParam(),
    },
  • The registration function that defines the get-item-details tool within the MCP server.
    export function registerGetItemDetailsTool(server: McpServer) {
      server.tool(
        "get-item-details",
        "Get item details for a Rollbar item",
        {
          counter: z.number().int().describe("Rollbar item counter"),
          max_tokens: z
            .number()
            .int()
            .optional()
            .default(20000)
            .describe(
              "Maximum tokens for occurrence data in response (default: 20000). Occurrence response will be truncated if it exceeds this limit.",
            ),
          project: buildProjectParam(),
        },
        async ({ counter, max_tokens, project }) => {
          const { token, apiBase } = resolveProject(project);
          // Redirects are followed, so we get an item response from the counter request
          const counterUrl = `${apiBase}/item_by_counter/${counter}`;
          const itemResponse = await makeRollbarRequest<
            RollbarApiResponse<RollbarItemResponse>
          >(counterUrl, "get-item-details", token);
    
          if (itemResponse.err !== 0) {
            const errorMessage =
              itemResponse.message || `Unknown error (code: ${itemResponse.err})`;
            throw new Error(`Rollbar API returned error: ${errorMessage}`);
          }
    
          const item = itemResponse.result;
    
          const occurrenceUrl = `${apiBase}/instance/${item.last_occurrence_id}`;
          const occurrenceResponse = await makeRollbarRequest<
            RollbarApiResponse<RollbarOccurrenceResponse>
          >(occurrenceUrl, "get-item-details", token);
    
          if (occurrenceResponse.err !== 0) {
            // We got the item but failed to get occurrence. Return just the item data.
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(item),
                },
              ],
            };
          }
    
          const occurrence = occurrenceResponse.result;
    
          // Remove the metadata section from occurrence.data
          if (occurrence.data && occurrence.data.metadata) {
            delete occurrence.data.metadata;
          }
    
          // Combine item and occurrence data
          const responseData = {
            ...item,
            occurrence: truncateOccurrence(occurrence, max_tokens),
          };
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(responseData),
              },
            ],
          };
        },
      );
    }
Behavior2/5

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

No annotations provided, so description carries full burden, yet discloses no behavioral traits. Fails to explain the truncation behavior mentioned in the max_tokens schema description, what 'occurrence data' means, or the structure/format of returned item details. The verb 'Get' implies read-only, but safety profiles and return schemas remain undocumented.

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

Conciseness2/5

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

While brief (single sentence), this represents under-specification rather than effective conciseness. The sentence wastes the opportunity to add value beyond the tool name, failing to front-load critical distinctions or behavioral warnings that an agent would need to select this tool correctly.

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 and no annotations, the description must explain what details are returned and how they relate to Rollbar's data model (items vs occurrences). It omits this entirely. For a 3-parameter retrieval tool with 100% schema coverage, the description inadequately compensates for missing structured metadata about return values.

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%, establishing baseline 3. The description adds no parameter context beyond the schema (e.g., doesn't explain that 'counter' is a unique identifier, or clarify the project auto-detection behavior). However, schema adequately documents all three parameters including the optional nature of 'project' and truncation logic for 'max_tokens'.

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

Purpose2/5

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

The description 'Get item details for a Rollbar item' essentially restates the tool name (tautology) with the addition of the domain 'Rollbar'. It fails to specify what constitutes 'item details' (e.g., error metadata, stack traces, occurrences) or how this differs from siblings like list-items or update-item.

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

Usage Guidelines1/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 tool versus alternatives. Critical distinction missing between this single-item retrieval and list-items (presumably for multiple items), or when project parameter is required versus optional.

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