read_esa_post
Retrieve specific posts from esa.io using team name and post number parameters for content access and management.
Instructions
Read a post in esa.io.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamName | No | my-team | |
| postNumber | Yes |
Implementation Reference
- src/server.ts:101-120 (registration)Registration of the MCP tool 'read_esa_post' with description, input schema, and handler function using server.tool.server.tool( "read_esa_post", "Read a post in esa.io.", { teamName: z.string().default(getRequiredEnv("DEFAULT_ESA_TEAM")), postNumber: z.number(), }, async (input) => await formatTool(async () => { const [response] = await client.readPosts(input.teamName, [ input.postNumber, ]) if (response === undefined) { throw new Error("post not found") } return response }) )
- src/server.ts:108-120 (handler)The handler executes the tool logic: reads the post via ApiClient.readPosts for the given team and postNumber, checks if found, returns the post data.async (input) => await formatTool(async () => { const [response] = await client.readPosts(input.teamName, [ input.postNumber, ]) if (response === undefined) { throw new Error("post not found") } return response }) )
- src/server.ts:105-107 (schema)Input schema validation using Zod: teamName (string with default from env), postNumber (number).teamName: z.string().default(getRequiredEnv("DEFAULT_ESA_TEAM")), postNumber: z.number(), },
- src/api.ts:90-109 (helper)Supporting ApiClient.readPosts method that fetches post(s) using the generated ESA API client, removes body_html, returns array of post objects. Used by the tool handler.async readPosts(teamName: string, postNumbers: readonly number[]) { return await Promise.all( postNumbers.map(async (postNumber) => { const response = await this.callApi(() => getV1TeamsTeamNamePostsPostNumber( teamName, postNumber, {}, { headers: { Authorization: `Bearer ${this.apiKey}`, }, } ) ) const { body_html, ...others } = response.data return others }) ) }