Skip to main content
Glama

update_qiita_article

Modify an existing Qiita article by updating its title, body, tags, privacy status, organization, or slide mode using the article ID. Simplifies content management on Qiita.

Instructions

update an existing Qiita article

Input Schema

NameRequiredDescriptionDefault
bodyYesMarkdown formatted content
item_idYesThe ID of the article to update
organization_url_nameNoThe url_name of the organization for the article
privateNoWhether the article is private
slideNoWhether to enable slide mode
tagsNoList of tags for the article
titleYesArticle title

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "body": { "description": "Markdown formatted content", "type": "string" }, "item_id": { "description": "The ID of the article to update", "type": "string" }, "organization_url_name": { "description": "The url_name of the organization for the article", "type": "string" }, "private": { "description": "Whether the article is private", "type": "boolean" }, "slide": { "description": "Whether to enable slide mode", "type": "boolean" }, "tags": { "description": "List of tags for the article", "items": { "additionalProperties": false, "properties": { "name": { "description": "Tag name", "type": "string" }, "versions": { "description": "Versions (optional)", "items": { "type": "string" }, "type": "array" } }, "required": [ "name" ], "type": "object" }, "type": "array" }, "title": { "description": "Article title", "type": "string" } }, "required": [ "item_id", "title", "body" ], "type": "object" }

Implementation Reference

  • The handler function that implements the 'update_qiita_article' tool logic. It destructures the params, calls the QiitaApiService.updateItem method, formats a success response with Japanese text, or returns an error response.
    const updateQiitaArticle = async (params: UpdateArticleParams): Promise<any> => { try { const { item_id, ...updateParams } = params; const updatedItem = await apiService.updateItem(item_id, updateParams); return createSuccessResponse( `記事が正常に更新されました。\nタイトル: ${updatedItem.title}\nURL: ${updatedItem.url}\n\n` + JSON.stringify(updatedItem, null, 2) ); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return createErrorResponse(`Error updating Qiita article: ${errorMessage}`); } };
  • Zod schema defining the input parameters for the update_qiita_article tool, including item_id, title, body, optional tags, private, organization_url_name, and slide.
    const updateArticleSchema = z.object({ item_id: z.string().describe("The ID of the article to update"), 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)") })).optional().describe("List of tags for the article"), private: z.boolean().optional().describe("Whether the article is private"), 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 UpdateArticleParams = z.infer<typeof updateArticleSchema>;
  • Registration of the 'update_qiita_article' tool within the getToolDefinitions() export, specifying name, description, parameters schema, and handler.
    { name: "update_qiita_article", description: "update an existing Qiita article", parameters: updateArticleSchema.shape, handler: (params: UpdateArticleParams) => updateQiitaArticle(params) },
  • The QiitaApiService.updateItem method, which performs the actual PATCH request to the Qiita API to update the article, handles authentication, removes undefined fields, and filters the response.
    updateItem = async ( item_id: string, params: { title: string; body: string; tags?: Array<{ name: string; versions?: string[] }>; private?: boolean; organization_url_name?: string; slide?: boolean; } ): Promise<any> => { this.validateToken(); const requestBody = this.removeUndefinedFields(params); const response = await fetch( `${this.baseUrl}/items/${item_id}`, { method: 'PATCH', headers: this.getHeaders(), body: JSON.stringify(requestBody) } ); if (!response.ok) { await this.handleErrorResponse(response); } const item = await response.json(); return this.filterItem(item); };

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/2bo/qiita-mcp-server'

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