post_qiita_article
Publish articles on Qiita with customizable options for title, content, tags, privacy, and more. Streamline content sharing using a standardized MCP tool for efficient publishing.
Instructions
create a new article on Qiita
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Markdown formatted content | |
| organization_url_name | No | The url_name of the organization for the article | |
| private | No | Whether the article is private | |
| slide | No | Whether to enable slide mode | |
| tags | Yes | List of tags for the article | |
| title | Yes | Article title | |
| tweet | No | Whether to post to Twitter |
Implementation Reference
- src/tools/qiitaTools.ts:76-88 (handler)The main handler function for the 'post_qiita_article' tool. It uses the QiitaApiService to create a new article and returns a success or error response.const postQiitaArticle = async (params: PostArticleParams): Promise<any> => { try { const newItem = await apiService.createItem(params); return createSuccessResponse( `記事が正常に投稿されました。\nタイトル: ${newItem.title}\nURL: ${newItem.url}\n\n` + JSON.stringify(newItem, null, 2) ); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return createErrorResponse(`Error posting Qiita article: ${errorMessage}`); } };
- src/tools/qiitaTools.ts:62-74 (schema)Zod schema defining the input parameters for the post_qiita_article tool, including title, body, tags, etc., and the inferred TypeScript type.const postArticleSchema = z.object({ title: z.string().describe("Article title"), body: z.string().describe("Markdown formatted content"), tags: z.array(z.object({ name: z.string().describe("Tag name"), versions: z.array(z.string()).optional().describe("Versions (optional)") })).describe("List of tags for the article"), private: z.boolean().optional().default(true).describe("Whether the article is private"), tweet: z.boolean().optional().describe("Whether to post to Twitter"), organization_url_name: z.string().optional().describe("The url_name of the organization for the article"), slide: z.boolean().optional().describe("Whether to enable slide mode") }); type PostArticleParams = z.infer<typeof postArticleSchema>;
- src/tools/qiitaTools.ts:149-154 (registration)The registration of the 'post_qiita_article' tool within the getToolDefinitions array, specifying name, description, parameters schema, and handler.{ name: "post_qiita_article", description: "create a new article on Qiita", parameters: postArticleSchema.shape, handler: (params: PostArticleParams) => postQiitaArticle(params) },