Skip to main content
Glama

esa_list_posts

Retrieve and manage team posts with pagination, search queries, and customizable sorting options to organize documentation efficiently.

Instructions

Get a list of posts in the team (with pagination support)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoSearch query (see esa API documentation for details)
includeNoRelated data to include in the response (e.g. 'comments,stargazers')
sortNoSort method (updated, created, number, stars, watches, comments, best_match)updated
orderNoSort order (desc, asc)desc
per_pageNoNumber of results per page (default: 20, max: 100)
pageNoPage number to retrieve

Implementation Reference

  • Executes the esa_list_posts tool by parsing arguments and calling the EsaClient.listPosts method to fetch posts from the ESA API.
    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) }], }; }
  • Defines the Tool object for esa_list_posts, including name, description, and detailed inputSchema with properties for search, pagination, sorting, etc.
    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-619 (registration)
    Registers the esa_list_posts tool (via listPostsTool) in the ListToolsRequest handler's tools array.
    tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ], }; });
  • EsaClient method that constructs the API request to list posts based on provided arguments and fetches data from the ESA API.
    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(); }
  • TypeScript interface defining the argument types for esa_list_posts tool.
    interface ListPostsArgs { q?: string; include?: string; sort?: string; order?: string; per_page?: number; page?: number; }

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/kajirita2002/esa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server