get_project_comments
Retrieve community comments and discussions for a specific WebSim project to analyze feedback and user interactions.
Instructions
Get comments for a WebSim project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | WebSim project ID | |
| limit | No | Number of comments to return (default: 20) | |
| offset | No | Number of comments to skip (default: 0) |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"default": 20,
"description": "Number of comments to return (default: 20)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Number of comments to skip (default: 0)",
"type": "number"
},
"project_id": {
"description": "WebSim project ID",
"type": "string"
}
},
"required": [
"project_id"
],
"type": "object"
}
Implementation Reference
- server.js:1022-1035 (handler)The main handler function for the 'get_project_comments' tool. It validates input args using ProjectCommentsSchema, calls the API client's getProjectComments method, and returns a formatted JSON response with the comments data.handler: async (args) => { const { project_id, limit = 20, offset = 0 } = ProjectCommentsSchema.parse(args); const result = await apiClient.getProjectComments(project_id, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} comments for project ${project_id}` }, null, 2) }] }; }
- server.js:59-63 (schema)Zod schema used for input validation in the get_project_comments tool handler.const ProjectCommentsSchema = z.object({ project_id: z.string().describe('WebSim project ID'), limit: z.number().optional().default(20).describe('Number of comments to return'), offset: z.number().optional().default(0).describe('Number of comments to skip') });
- server.js:999-1035 (registration)Tool registration object in the tools array, including name, description, inputSchema (JSON schema), and handler reference. This defines and registers the 'get_project_comments' tool with the MCP server.{ name: "get_project_comments", description: "Get comments for a WebSim project", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "WebSim project ID" }, limit: { type: "number", description: "Number of comments to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of comments to skip (default: 0)", default: 0 } }, required: ["project_id"] }, handler: async (args) => { const { project_id, limit = 20, offset = 0 } = ProjectCommentsSchema.parse(args); const result = await apiClient.getProjectComments(project_id, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} comments for project ${project_id}` }, null, 2) }] }; }
- server.js:223-226 (helper)API client helper method that makes the HTTP request to fetch project comments from the WebSim API, used by the tool handler.async getProjectComments(projectId, limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/projects/${projectId}/comments?${params}`); }