Skip to main content
Glama

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

NameRequiredDescriptionDefault
project_idYesWebSim project ID
limitNoNumber of comments to return (default: 20)
offsetNoNumber 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

  • 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) }] }; }
  • 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) }] }; }
  • 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}`); }

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