list_all_projects
Retrieve all public WebSim projects with pagination controls to browse and explore available content in the community.
Instructions
List all public WebSim projects with pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of projects to return (default: 20) | |
| offset | No | Number of projects to skip (default: 0) |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"default": 20,
"description": "Number of projects to return (default: 20)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Number of projects to skip (default: 0)",
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- server.js:317-330 (handler)The handler function for the list_all_projects MCP tool. It extracts limit and offset from arguments, calls the API client's listAllProjects method, and returns a formatted JSON response with the results.handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.listAllProjects(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} projects (offset: ${offset})` }, null, 2) }] }; }
- server.js:302-316 (schema)Zod input schema validation is not directly used here, but the JSON schema defines optional limit (default 20) and offset (default 0) parameters for paginating project lists.inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of projects to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of projects to skip (default: 0)", default: 0 } } },
- server.js:299-331 (registration)The complete tool registration object added to the tools array, which is used by the MCP server to handle list_all_projects tool calls.{ name: "list_all_projects", description: "List all public WebSim projects with pagination", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of projects to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of projects to skip (default: 0)", default: 0 } } }, handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.listAllProjects(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} projects (offset: ${offset})` }, null, 2) }] }; } },
- server.js:112-115 (helper)Helper method in WebSimAPIClient class that makes the HTTP request to fetch paginated list of all public projects from the WebSim API.async listAllProjects(limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/projects?${params}`); }