Skip to main content
Glama

esa_create_post

Create new posts in esa with titles, markdown content, tags, and categories to organize team documentation.

Instructions

Create a new post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPost title
body_mdNoPost body (Markdown format)
tagsNoList of tags for the post
categoryNoPost category
wipNoWhether to mark as WIP (Work In Progress)
messageNoChange message
userNoPoster's screen_name (only team owners can specify)
template_post_idNoID of the post to use as a template

Implementation Reference

  • Handler for the 'esa_create_post' tool in the CallToolRequest switch statement. Validates input and calls esaClient.createPost to execute the tool.
    case "esa_create_post": {
      const args = request.params.arguments as unknown as CreatePostArgs;
      if (!args.name) {
        throw new Error("name is required");
      }
      const response = await esaClient.createPost(args);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Tool definition including name, description, and input schema for 'esa_create_post'.
    const createPostTool: Tool = {
      name: "esa_create_post",
      description: "Create a new post",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Post title",
          },
          body_md: {
            type: "string",
            description: "Post body (Markdown format)",
          },
          tags: {
            type: "array",
            items: { type: "string" },
            description: "List of tags for the post",
          },
          category: {
            type: "string",
            description: "Post category",
          },
          wip: {
            type: "boolean",
            description: "Whether to mark as WIP (Work In Progress)",
            default: true,
          },
          message: {
            type: "string",
            description: "Change message",
          },
          user: {
            type: "string",
            description: "Poster's screen_name (only team owners can specify)",
          },
          template_post_id: {
            type: "number",
            description: "ID of the post to use as a template",
          },
        },
        required: ["name"],
      },
    };
  • index.ts:607-619 (registration)
    Registration of 'esa_create_post' tool (via createPostTool) in the ListToolsRequest handler's tools array.
        tools: [
          listPostsTool,
          getPostTool,
          createPostTool,
          updatePostTool,
          listCommentsTool,
          getCommentTool,
          createCommentTool,
          getMembersTool,
          getMemberTool,
        ],
      };
    });
  • EsaClient method that performs the HTTP POST request to create a new post on the Esa API.
    async createPost(postData: Omit<CreatePostArgs, 'template_post_id'> & { template_post_id?: number }): Promise<any> {
      const url = `${this.baseUrl}/posts`;
      const response = await fetch(url, {
        method: "POST",
        headers: this.headers,
        body: JSON.stringify({ post: postData }),
      });
    
      return response.json();
    }
  • TypeScript interface defining the arguments for createPost, used for type validation in the handler.
    interface CreatePostArgs {
      name: string;
      body_md?: string;
      tags?: string[];
      category?: string;
      wip?: boolean;
      message?: string;
      user?: string;
      template_post_id?: 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