update_item
Modify existing articles on Qiita by updating titles, content in Markdown format, tags, and privacy settings using the article ID.
Instructions
既存の記事を更新します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | 記事の本文(Markdown形式) | |
| itemId | Yes | 記事ID | |
| private | No | 非公開記事かどうか | |
| tags | Yes | タグの配列 | |
| title | Yes | 記事のタイトル |
Implementation Reference
- src/tools/handlers.ts:100-102 (handler)MCP tool handler definition for 'update_item', which destructures the input and delegates to the QiitaApiClient's updateItem method.update_item: { schema: updateItemSchema, execute: async ({ itemId, ...rest }, client) => client.updateItem(itemId, rest),
- src/tools/handlers.ts:44-50 (schema)Zod input schema for validating 'update_item' tool parameters.const updateItemSchema = z.object({ itemId: z.string(), title: z.string(), body: z.string(), tags: z.array(tagSpecificationSchema), private: z.boolean().optional(), });
- src/tools/definitions.ts:230-277 (registration)Tool metadata registration for 'update_item' used in MCP list tools response, including JSON input schema.{ name: 'update_item', description: '既存の記事を更新します', inputSchema: { type: 'object', properties: { itemId: { type: 'string', description: '記事ID', }, 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, }, }, required: ['itemId', 'title', 'body', 'tags'], }, },
- src/qiitaApiClient.ts:88-97 (helper)QiitaApiClient helper method that executes the HTTP PATCH request to update the specified item on Qiita.async updateItem(itemId: string, item: { title: string; body: string; tags: Array<{ name: string; versions: string[] }>; private?: boolean; }) { this.assertAuthenticated(); const response = await this.client.patch(`/items/${itemId}`, item); return response.data; }