rollbar_get_project
Retrieve project details from Rollbar error tracking by specifying the project ID to access configuration, settings, and metadata.
Instructions
Get a specific project from Rollbar
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Project ID |
Implementation Reference
- src/rollbar.ts:480-504 (handler)Handler implementation for the 'rollbar_get_project' tool. Fetches project details from Rollbar API using the account client and effective project ID.case "rollbar_get_project": { // Account Token is required if (!accountClient) { throw new Error("ROLLBAR_ACCOUNT_TOKEN is not set, cannot use this API"); } const { id } = args as { id: number }; // Use environment variable project ID as default value, or search by project name const effectiveProjectId = await getEffectiveProjectId(id); if (!effectiveProjectId) { throw new Error("Project ID is required but not provided in request or environment variables"); } const response = await accountClient.get<ProjectResponse>(`/project/${effectiveProjectId}`); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/rollbar.ts:213-223 (schema)Tool schema for 'rollbar_get_project' defining the input schema requiring a project 'id'.const GET_PROJECT_TOOL: Tool = { name: "rollbar_get_project", description: "Get a specific project from Rollbar", inputSchema: { type: "object", properties: { id: { type: "number", description: "Project ID" }, }, required: ["id"], }, };
- src/rollbar.ts:298-314 (registration)Registration of the 'rollbar_get_project' tool (as GET_PROJECT_TOOL) in the listTools request handler.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, ], }));
- src/rollbar.ts:86-100 (helper)Helper function 'getEffectiveProjectId' used by the handler to resolve the project ID from args, env vars, or project name search.const getEffectiveProjectId = async (providedId?: number): Promise<number | undefined> => { // Use provided ID if available if (providedId) return providedId; // Use project ID from environment variable if available if (ROLLBAR_PROJECT_ID) return ROLLBAR_PROJECT_ID; // Search by project name if (ROLLBAR_PROJECT_NAME) { const idFromName = await findProjectIdByName(ROLLBAR_PROJECT_NAME); if (idFromName) return idFromName; } return undefined; };