get_posts_feed
Retrieve recent posts from WebSim's community feed to browse projects, discover content, and access discussions.
Instructions
Get latest posts from WebSim feed
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of posts to return (default: 20) | |
| offset | No | Number of posts to skip (default: 0) |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"default": 20,
"description": "Number of posts to return (default: 20)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Number of posts to skip (default: 0)",
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- server.js:695-707 (handler)The MCP tool handler that destructures input arguments, invokes the API client's getPostsFeed method, and returns a formatted text content response with the API result.handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getPostsFeed(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} latest posts` }, null, 2) }] };
- server.js:680-694 (schema)Input schema for the get_posts_feed tool, defining optional limit and offset parameters with defaults.inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of posts to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of posts to skip (default: 0)", default: 0 } } },
- server.js:677-709 (registration)Registration of the get_posts_feed tool in the tools array, including name, description, inputSchema, and handler.{ name: "get_posts_feed", description: "Get latest posts from WebSim feed", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of posts to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of posts to skip (default: 0)", default: 0 } } }, handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getPostsFeed(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} latest posts` }, null, 2) }] }; } },
- server.js:170-172 (helper)Helper method in WebSimAPIClient class that constructs the API request to fetch posts feed from /api/v1/feed/posts endpoint.async getPostsFeed(limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/feed/posts?${params}`);