Skip to main content
Glama

Create Article

create_article

Generate and publish blog articles on Emlog by defining title, content, excerpt, tags, cover image, category, draft status, and comment settings through structured input.

Instructions

Create a new blog article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allow_remarkNoWhether to allow comments
contentYesThe content of the article
coverNoThe cover image URL
draftNoWhether to save as draft (y) or publish (n)
excerptNoThe excerpt/summary of the article
sort_idNoThe category ID for the article
tagsNoComma-separated tags for the article
titleYesThe title of the article
topNoWhether to pin to homepage

Implementation Reference

  • src/index.ts:162-208 (registration)
    Registration of the 'create_article' MCP tool, including input schema, description, and handler function that delegates to EmlogClient.createArticle
    server.registerTool(
      "create_article",
      {
        title: "Create Article",
        description: "Create a new blog article",
        inputSchema: {
          title: z.string().describe("The title of the article"),
          content: z.string().describe("The content of the article"),
          excerpt: z.string().optional().describe("The excerpt/summary of the article"),
          cover: z.string().optional().describe("The cover image URL"),
          sort_id: z.number().optional().describe("The category ID for the article"),
          tags: z.string().optional().describe("Comma-separated tags for the article"),
          draft: z.enum(["y", "n"]).optional().describe("Whether to save as draft (y) or publish (n)"),
          top: z.enum(["y", "n"]).optional().describe("Whether to pin to homepage"),
          allow_remark: z.enum(["y", "n"]).optional().describe("Whether to allow comments")
        }
      },
      async ({ title, content, excerpt, cover, sort_id, tags, draft, top, allow_remark }) => {
        try {
          const result = await emlogClient.createArticle({
            title,
            content,
            excerpt,
            cover,
            sort_id,
            tags,
            draft,
            top,
            allow_remark
          });
          return {
            content: [{
              type: "text",
              text: `Successfully created article: ${title} (ID: ${result.article_id || 'unknown'})`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error: ${error instanceof Error ? error.message : String(error)}`
            }],
            isError: true
          };
        }
      }
    );
  • Core handler in EmlogClient that executes the API POST request to create a new article via '/?rest-api=article_post' endpoint
    async createArticle(article: {
      title: string;
      content: string;
      excerpt?: string;
      cover?: string;
      author_uid?: number;
      sort_id?: number;
      tags?: string;
      draft?: 'y' | 'n';
      post_date?: string;
      top?: 'y' | 'n';
      sortop?: 'y' | 'n';
      allow_remark?: 'y' | 'n';
      password?: string;
      link?: string;
      field_keys?: string[];
      field_values?: string[];
      auto_cover?: 'y' | 'n';
    }): Promise<{ article_id: number }> {
      const formData = this.buildFormData(article);
      const response = await this.api.post('/?rest-api=article_post', formData);
      return response.data.data;
    }
  • Zod input schema defining parameters for the create_article tool, including title, content, optional fields like excerpt, cover, category, tags, draft status, etc.
    inputSchema: {
      title: z.string().describe("The title of the article"),
      content: z.string().describe("The content of the article"),
      excerpt: z.string().optional().describe("The excerpt/summary of the article"),
      cover: z.string().optional().describe("The cover image URL"),
      sort_id: z.number().optional().describe("The category ID for the article"),
      tags: z.string().optional().describe("Comma-separated tags for the article"),
      draft: z.enum(["y", "n"]).optional().describe("Whether to save as draft (y) or publish (n)"),
      top: z.enum(["y", "n"]).optional().describe("Whether to pin to homepage"),
      allow_remark: z.enum(["y", "n"]).optional().describe("Whether to allow comments")
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create a new blog article' implies a write/mutation operation but provides no information about permissions required, whether creation is reversible, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise with a single sentence that gets straight to the point. There's zero wasted language or unnecessary elaboration - it's front-loaded with the essential information about what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 9 parameters, no annotations, and no output schema, the description is inadequate. It doesn't address behavioral aspects, error conditions, return values, or how this tool relates to siblings. The combination of being a write operation with complex inputs requires more contextual information than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what's already in the schema (which has 100% coverage). All 9 parameters are documented in the schema with descriptions, so the baseline score of 3 is appropriate. The description doesn't provide additional context about parameter relationships, default behaviors, or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('blog article'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_note' or 'update_article' - it just states the basic function without clarifying what distinguishes this specific article creation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create_note' or 'update_article'. There's no mention of prerequisites, appropriate contexts, or when this specific article creation tool should be chosen over other creation/mutation tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/eraincc/emlog-mcp'

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