Skip to main content
Glama
rollbar

Rollbar MCP Server

Official
by rollbar

get-deployments

Retrieve deployment data from Rollbar to monitor release history and track changes across projects.

Instructions

Get deployments data from Rollbar

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYesNumber of Rollbar deployments to retrieve
projectNoProject name (optional when only one project is configured)

Implementation Reference

  • The handler function for the "get-deployments" tool, which executes the request to the Rollbar API.
    async ({ limit, project }) => {
      const { token, apiBase } = resolveProject(project);
      const deploysUrl = `${apiBase}/deploys?limit=${limit}`;
      const deploysResponse = await makeRollbarRequest<
        RollbarApiResponse<RollbarDeployResponse>
      >(deploysUrl, "get-deployments", token);
    
      if (deploysResponse.err !== 0) {
        const errorMessage =
          deploysResponse.message ||
          `Unknown error (code: ${deploysResponse.err})`;
        throw new Error(`Rollbar API returned error: ${errorMessage}`);
      }
    
      const deployments = deploysResponse.result;
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(deployments),
          },
        ],
      };
    },
  • Registration of the "get-deployments" tool with the MCP server.
    export function registerGetDeploymentsTool(server: McpServer) {
      server.tool(
        "get-deployments",
        "Get deployments data from Rollbar",
        {
          limit: z
            .number()
            .int()
            .describe("Number of Rollbar deployments to retrieve"),
          project: buildProjectParam(),
        },
        async ({ limit, project }) => {
          const { token, apiBase } = resolveProject(project);
          const deploysUrl = `${apiBase}/deploys?limit=${limit}`;
          const deploysResponse = await makeRollbarRequest<
            RollbarApiResponse<RollbarDeployResponse>
          >(deploysUrl, "get-deployments", token);
    
          if (deploysResponse.err !== 0) {
            const errorMessage =
              deploysResponse.message ||
              `Unknown error (code: ${deploysResponse.err})`;
            throw new Error(`Rollbar API returned error: ${errorMessage}`);
          }
    
          const deployments = deploysResponse.result;
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(deployments),
              },
            ],
          };
        },
      );

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