esa_list_posts
Retrieve a paginated list of team posts with customizable sorting, filtering, and related data inclusion using the esa MCP Server interface.
Instructions
Get a list of posts in the team (with pagination support)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Related data to include in the response (e.g. 'comments,stargazers') | |
| order | No | Sort order (desc, asc) | desc |
| page | No | Page number to retrieve | |
| per_page | No | Number of results per page (default: 20, max: 100) | |
| q | No | Search query (see esa API documentation for details) | |
| sort | No | Sort method (updated, created, number, stars, watches, comments, best_match) | updated |
Implementation Reference
- index.ts:483-489 (handler)MCP tool handler for 'esa_list_posts': extracts arguments from request and calls EsaClient.listPosts to fetch posts, returns JSON response.case "esa_list_posts": { const args = request.params.arguments as unknown as ListPostsArgs; const response = await esaClient.listPosts(args); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:340-354 (helper)Core implementation of listing Esa posts: builds query parameters from args and fetches from Esa API endpoint.async listPosts(args: ListPostsArgs = {}): Promise<any> { const params = new URLSearchParams(); if (args.q) params.append("q", args.q); if (args.include) params.append("include", args.include); if (args.sort) params.append("sort", args.sort); if (args.order) params.append("order", args.order); if (args.per_page) params.append("per_page", args.per_page.toString()); if (args.page) params.append("page", args.page.toString()); const url = `${this.baseUrl}/posts${params.toString() ? `?${params}` : ""}`; const response = await fetch(url, { headers: this.headers }); return response.json(); }
- index.ts:76-112 (schema)Tool definition including name, description, and detailed input schema for esa_list_posts.const listPostsTool: Tool = { name: "esa_list_posts", description: "Get a list of posts in the team (with pagination support)", inputSchema: { type: "object", properties: { q: { type: "string", description: "Search query (see esa API documentation for details)", }, include: { type: "string", description: "Related data to include in the response (e.g. 'comments,stargazers')", }, sort: { type: "string", description: "Sort method (updated, created, number, stars, watches, comments, best_match)", default: "updated", }, order: { type: "string", description: "Sort order (desc, asc)", default: "desc", }, per_page: { type: "number", description: "Number of results per page (default: 20, max: 100)", default: 20, }, page: { type: "number", description: "Page number to retrieve", default: 1, }, }, }, };
- index.ts:607-617 (registration)Registration of esa_list_posts (as listPostsTool) in the list of available tools returned by ListToolsRequest.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ],
- index.ts:12-19 (schema)TypeScript interface defining the expected input arguments for esa_list_posts tool.interface ListPostsArgs { q?: string; include?: string; sort?: string; order?: string; per_page?: number; page?: number; }