Skip to main content
Glama

create_article

Generate SEO-friendly articles by specifying topic, target keyword, word count, language, and tone. Automate article creation with AI for optimized content writing.

Instructions

Create a new article

Input Schema

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

Implementation Reference

  • The primary handler function for the 'create_article' tool. Constructs the API request payload with article parameters and performs a POST request to the '/articles' endpoint, returning success or error response.
    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:232-268 (registration)
    Registration of the 'create_article' tool in the ListTools response, including name, description, and detailed inputSchema.
    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 parameters expected by the createArticle handler.
    interface CreateArticleRequest { targetArticleTopic: string; targetKeyword?: string; wordCount?: number; language?: string; articleType?: string; toneOfVoice?: string; }
  • TypeScript interface defining the expected response structure from the create article API call.
    interface CreateArticleResponse { id: string; status: string; [key: string]: any; }
  • Dispatch handler case in the CallToolRequestSchema that validates tool arguments and invokes the createArticle method.
    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); }

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/pushkarsingh32/semantic-pen-mcp-server'

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