create_item
Create and publish articles on Qiita, a Japanese developer community platform. Write content in Markdown, add tags, and control visibility settings.
Instructions
新しい記事を作成します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | 記事のタイトル | |
| body | Yes | 記事の本文(Markdown形式) | |
| tags | Yes | タグの配列 | |
| private | No | 非公開記事かどうか | |
| tweet | No | Twitterに投稿するかどうか |
Implementation Reference
- src/tools/handlers.ts:96-98 (handler)Handler definition for the 'create_item' tool, which delegates execution to the QiitaApiClient's createItem method.create_item: { schema: createItemSchema, execute: async (input, client) => client.createItem(input),
- src/tools/handlers.ts:31-42 (schema)Zod schemas defining the input validation for the create_item tool, including tag specification.const tagSpecificationSchema = z.object({ name: z.string(), versions: z.array(z.string()), }); const createItemSchema = z.object({ title: z.string(), body: z.string(), tags: z.array(tagSpecificationSchema), private: z.boolean().default(false), tweet: z.boolean().default(false), });
- src/tools/definitions.ts:181-229 (registration)MCP tool registration for 'create_item', providing the tool name, description, and JSON input schema used by the MCP server.{ name: 'create_item', description: '新しい記事を作成します', inputSchema: { type: 'object', properties: { title: { type: 'string', description: '記事のタイトル', }, body: { type: 'string', description: '記事の本文(Markdown形式)', }, tags: { type: 'array', description: 'タグの配列', items: { type: 'object', properties: { name: { type: 'string', description: 'タグ名', }, versions: { type: 'array', description: 'タグのバージョン', items: { type: 'string', }, }, }, required: ['name', 'versions'], }, }, private: { type: 'boolean', description: '非公開記事かどうか', default: false, }, tweet: { type: 'boolean', description: 'Twitterに投稿するかどうか', default: false, }, }, required: ['title', 'body', 'tags'], }, },
- src/qiitaApiClient.ts:76-86 (helper)The Qiita API client method that performs the actual HTTP POST request to create an item on Qiita.async createItem(item: { title: string; body: string; tags: Array<{ name: string; versions: string[] }>; private?: boolean; tweet?: boolean; }) { this.assertAuthenticated(); const response = await this.client.post('/items', item); return response.data; }