get_project_assets
Retrieve assets for a WebSim project version to access project resources and content.
Instructions
Get assets for a specific project version
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | WebSim project ID | |
| version | No | Project version (default: latest) | latest |
Input Schema (JSON Schema)
{
"properties": {
"project_id": {
"description": "WebSim project ID",
"type": "string"
},
"version": {
"default": "latest",
"description": "Project version (default: latest)",
"type": "string"
}
},
"required": [
"project_id"
],
"type": "object"
}
Implementation Reference
- server.js:984-997 (handler)The MCP tool handler for 'get_project_assets' that validates input with ProjectRevisionSchema, fetches assets via apiClient, and formats the response as JSON text content.handler: async (args) => { const { project_id, version = 'latest' } = ProjectRevisionSchema.parse(args); const result = await apiClient.getProjectAssets(project_id, version); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved assets for project ${project_id} (version: ${version})` }, null, 2) }] }; }
- server.js:969-983 (schema)Input schema defining the parameters for the 'get_project_assets' tool: project_id (required string) and version (optional string, default 'latest').inputSchema: { type: "object", properties: { project_id: { type: "string", description: "WebSim project ID" }, version: { type: "string", description: "Project version (default: latest)", default: "latest" } }, required: ["project_id"] },
- server.js:966-998 (registration)The tool registration object added to the 'tools' array, specifying name, description, inputSchema, and handler for 'get_project_assets'.{ name: "get_project_assets", description: "Get assets for a specific project version", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "WebSim project ID" }, version: { type: "string", description: "Project version (default: latest)", default: "latest" } }, required: ["project_id"] }, handler: async (args) => { const { project_id, version = 'latest' } = ProjectRevisionSchema.parse(args); const result = await apiClient.getProjectAssets(project_id, version); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved assets for project ${project_id} (version: ${version})` }, null, 2) }] }; } },
- server.js:217-220 (helper)Helper method in WebSimAPIClient class that makes the HTTP request to retrieve assets for a specific project revision/version.async getProjectAssets(projectId, version = 'latest') { const params = new URLSearchParams({ version }); return this.makeRequest(`/api/v1/projects/${projectId}/revisions/${version}/assets?${params}`); }
- server.js:32-35 (schema)Zod validation schema used by the tool handler to parse and validate the input arguments (project_id required, version optional).const ProjectRevisionSchema = z.object({ project_id: z.string().describe('WebSim project ID'), version: z.string().optional().describe('Project version (default: latest)') });