Skip to main content
Glama
pushkarsingh32

Semantic Pen MCP Server

create_article

Generate SEO-optimized articles by specifying topic, keyword, word count, language, and tone for content creation.

Instructions

Create a new article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetArticleTopicYesThe topic/title for the article
targetKeywordNoTarget SEO keyword for the article (optional)
wordCountNoTarget word count (default: 1000)
languageNoLanguage for the article (default: English)English
articleTypeNoType of article (default: Article)Article
toneOfVoiceNoTone of voice (default: Professional)Professional

Implementation Reference

  • The primary handler function that executes the create_article tool logic. It constructs the request payload from input arguments, sends a POST request to the '/articles' API endpoint using makeRequest, and formats a success response with the new article's ID or an error message.
    private async createArticle(args: CreateArticleRequest) {
      const request = {
        targetArticleTopic: args.targetArticleTopic,
        targetKeyword: args.targetKeyword || '',
        wordCount: args.wordCount || 1000,
        language: args.language || 'English',
        articleType: args.articleType || 'Article',
        toneOfVoice: args.toneOfVoice || 'Professional'
      };
    
      const result = await this.makeRequest<CreateArticleResponse>('/articles', {
        method: 'POST',
        data: request
      });
      
      if (result.success && result.data) {
        return {
          content: [
            {
              type: "text",
              text: `āœ… **Article Created Successfully!**\n\n**Topic:** ${args.targetArticleTopic}\n**Article ID:** ${result.data.id}\n**Status:** ${result.data.status}\n**Settings:**\n- Keyword: ${args.targetKeyword || 'None'}\n- Word Count: ${args.wordCount || 1000}\n- Language: ${args.language || 'English'}\n- Type: ${args.articleType || 'Article'}\n- Tone: ${args.toneOfVoice || 'Professional'}\n\nšŸ”„ Your article is being generated. Use \`get_article\` with ID \`${result.data.id}\` to check progress and retrieve the content.`
            }
          ]
        };
      } else {
        return {
          content: [
            {
              type: "text",
              text: `āŒ Failed to create article: ${result.error}`
            }
          ],
          isError: true
        };
      }
    }
  • src/index.ts:309-324 (registration)
    The dispatch logic in the CallToolRequestSchema handler that validates input arguments, constructs the CreateArticleRequest object, and delegates to the createArticle handler function.
    case "create_article": {
      if (!args || typeof args !== 'object' || !('targetArticleTopic' in args) || typeof args.targetArticleTopic !== 'string') {
        throw new Error("targetArticleTopic is required and must be a string");
      }
      
      const createRequest: CreateArticleRequest = {
        targetArticleTopic: args.targetArticleTopic,
        targetKeyword: 'targetKeyword' in args && typeof args.targetKeyword === 'string' ? args.targetKeyword : undefined,
        wordCount: 'wordCount' in args && typeof args.wordCount === 'number' ? args.wordCount : undefined,
        language: 'language' in args && typeof args.language === 'string' ? args.language : undefined,
        articleType: 'articleType' in args && typeof args.articleType === 'string' ? args.articleType : undefined,
        toneOfVoice: 'toneOfVoice' in args && typeof args.toneOfVoice === 'string' ? args.toneOfVoice : undefined,
      };
      
      return await this.createArticle(createRequest);
    }
  • src/index.ts:231-268 (registration)
    The tool registration in the ListToolsRequestSchema response, defining the name, description, and input schema for the create_article tool.
    {
      name: "create_article",
      description: "Create a new article",
      inputSchema: {
        type: "object",
        properties: {
          targetArticleTopic: {
            type: "string",
            description: "The topic/title for the article"
          },
          targetKeyword: {
            type: "string",
            description: "Target SEO keyword for the article (optional)"
          },
          wordCount: {
            type: "integer",
            description: "Target word count (default: 1000)",
            default: 1000
          },
          language: {
            type: "string",
            description: "Language for the article (default: English)",
            default: "English"
          },
          articleType: {
            type: "string",
            description: "Type of article (default: Article)",
            default: "Article"
          },
          toneOfVoice: {
            type: "string",
            description: "Tone of voice (default: Professional)",
            default: "Professional"
          }
        },
        required: ["targetArticleTopic"]
      }
    },
  • TypeScript interface defining the input structure for the createArticle handler, used for type safety.
    interface CreateArticleRequest {
      targetArticleTopic: string;
      targetKeyword?: string;
      wordCount?: number;
      language?: string;
      articleType?: string;
      toneOfVoice?: string;
    }
  • TypeScript interface for the API response from creating an article.
    interface CreateArticleResponse {
      id: string;
      status: string;
      [key: string]: any;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only says 'Create a new article,' which implies a write operation, but fails to disclose side effects, authentication needs, rate limits, or what the response contains. For a mutation tool, this is a significant gap.

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 a single, front-loaded sentence with no waste. It is concise and to the point.

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?

The tool has 6 parameters, no output schema, and no annotations. The description fails to explain return values, associations (e.g., project membership), or any caveats. While it covers the basic purpose, it is incomplete for an agent to fully understand the tool's behavior.

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?

Schema description coverage is 100%, and all parameters have meaningful descriptions with defaults. The description itself adds no parameter-level detail, but since the schema fully documents them, the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description 'Create a new article' uses a specific verb and resource, clearly indicating the action and object. It distinguishes itself from sibling tools (get_projects, get_project_articles, search_projects, get_article) as the only 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, no mention of prerequisites, context, or exclusions. It merely states the action without any situational framing.

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