rollbar_list_occurrences
Retrieve and analyze error occurrences from Rollbar to identify patterns and troubleshoot issues efficiently.
Instructions
List occurrences of errors from Rollbar
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "rollbar_list_occurrences"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | No | Item ID to filter occurrences | |
| limit | No | Maximum number of occurrences to return (default: 20) | |
| page | No | Page number for pagination (default: 1) |
Implementation Reference
- src/rollbar.ts:411-443 (handler)Handler function for rollbar_list_occurrences tool. Fetches occurrences from Rollbar API, optionally filtered by itemId, using projectClient.
case "rollbar_list_occurrences": { // Project Token is required if (!projectClient) { throw new Error("ROLLBAR_PROJECT_TOKEN is not set, cannot use this API"); } const { itemId, limit = 20, page = 1, } = args as { itemId?: number; limit?: number; page?: number; }; const params: Record<string, string | number> = { page, limit }; let endpoint = "/occurrences"; if (itemId) { endpoint = `/item/${itemId}/instances`; } const response = await projectClient.get<ListOccurrencesResponse>(endpoint, { params }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } - src/rollbar.ts:179-190 (schema)Tool schema definition for rollbar_list_occurrences, including input schema for parameters like itemId, limit, page.
const LIST_OCCURRENCES_TOOL: Tool = { name: "rollbar_list_occurrences", description: "List occurrences of errors from Rollbar", inputSchema: { type: "object", properties: { itemId: { type: "number", description: "Item ID to filter occurrences" }, limit: { type: "number", description: "Maximum number of occurrences to return (default: 20)" }, page: { type: "number", description: "Page number for pagination (default: 1)" }, }, }, }; - src/rollbar.ts:298-315 (registration)Registration of all tools including rollbar_list_occurrences (as LIST_OCCURRENCES_TOOL) in the MCP server for the ListToolsRequest.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ LIST_ITEMS_TOOL, GET_ITEM_TOOL, GET_ITEM_BY_UUID_TOOL, GET_ITEM_BY_COUNTER_TOOL, LIST_OCCURRENCES_TOOL, GET_OCCURRENCE_TOOL, LIST_PROJECTS_TOOL, GET_PROJECT_TOOL, LIST_ENVIRONMENTS_TOOL, LIST_USERS_TOOL, GET_USER_TOOL, LIST_DEPLOYS_TOOL, GET_DEPLOY_TOOL, ], }));