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
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | WebSim project ID | |
| limit | No | Number of revisions to return (default: 20) | |
| offset | No | Number of revisions to skip (default: 0) |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"default": 20,
"description": "Number of revisions to return (default: 20)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Number of revisions to skip (default: 0)",
"type": "number"
},
"project_id": {
"description": "WebSim project ID",
"type": "string"
}
},
"required": [
"project_id"
],
"type": "object"
}
Implementation Reference
- server.js:393-406 (handler)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) }] }; }
- server.js:373-392 (schema)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) }] }; } },
- server.js:122-125 (helper)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}`); }
- server.js:23-25 (schema)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') });