Skip to main content
Glama

get_project_revisions

Retrieve all revisions of a WebSim project to track changes, review history, and manage project versions.

Instructions

Get all revisions of a WebSim project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesWebSim project ID
limitNoNumber of revisions to return (default: 20)
offsetNoNumber of revisions to skip (default: 0)

Implementation Reference

  • The handler function that implements the core logic of the 'get_project_revisions' tool. It parses input arguments, calls the API client to fetch revisions, and returns a formatted JSON response.
    handler: async (args) => {
      const { project_id, limit = 20, offset = 0 } = ProjectIdSchema.parse(args);
      const result = await apiClient.getProjectRevisions(project_id, limit, offset);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            success: true,
            data: result,
            message: `Successfully retrieved ${result.items?.length || 0} revisions for project ${project_id}`
          }, null, 2)
        }]
      };
    }
  • The input schema defining parameters for the get_project_revisions tool: project_id (required), limit, and offset.
    inputSchema: {
      type: "object",
      properties: {
        project_id: {
          type: "string",
          description: "WebSim project ID"
        },
        limit: {
          type: "number",
          description: "Number of revisions to return (default: 20)",
          default: 20
        },
        offset: {
          type: "number",
          description: "Number of revisions to skip (default: 0)",
          default: 0
        }
      },
      required: ["project_id"]
    },
  • server.js:370-407 (registration)
    The complete tool registration object added to the tools array, including name, description, inputSchema, and handler.
    {
      name: "get_project_revisions",
      description: "Get all revisions of a WebSim project",
      inputSchema: {
        type: "object",
        properties: {
          project_id: {
            type: "string",
            description: "WebSim project ID"
          },
          limit: {
            type: "number",
            description: "Number of revisions to return (default: 20)",
            default: 20
          },
          offset: {
            type: "number",
            description: "Number of revisions to skip (default: 0)",
            default: 0
          }
        },
        required: ["project_id"]
      },
      handler: async (args) => {
        const { project_id, limit = 20, offset = 0 } = ProjectIdSchema.parse(args);
        const result = await apiClient.getProjectRevisions(project_id, limit, offset);
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              success: true,
              data: result,
              message: `Successfully retrieved ${result.items?.length || 0} revisions for project ${project_id}`
            }, null, 2)
          }]
        };
      }
    },
  • The WebSimAPIClient helper method that makes the actual API request to fetch project revisions.
    async getProjectRevisions(projectId, limit = 20, offset = 0) {
      const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() });
      return this.makeRequest(`/api/v1/projects/${projectId}/revisions?${params}`);
    }
  • Shared Zod schema used for input validation in the get_project_revisions handler (and others).
    const ProjectIdSchema = z.object({
      project_id: z.string().describe('WebSim project ID')
    });

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/gigachadtrey/websimm'

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