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
| Name | Required | Description | Default |
|---|---|---|---|
| targetArticleTopic | Yes | The topic/title for the article | |
| targetKeyword | No | Target SEO keyword for the article (optional) | |
| wordCount | No | Target word count (default: 1000) | |
| language | No | Language for the article (default: English) | English |
| articleType | No | Type of article (default: Article) | Article |
| toneOfVoice | No | Tone of voice (default: Professional) | Professional |
Implementation Reference
- src/index.ts:498-533 (handler)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"] } },
- src/index.ts:91-98 (schema)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; }
- src/index.ts:100-104 (schema)TypeScript interface for the API response from creating an article.interface CreateArticleResponse { id: string; status: string; [key: string]: any; }