get_item
Retrieve a specific Qiita article using its unique ID to access content directly without searching through lists.
Instructions
Get a specific Qiita article by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | Article ID |
Implementation Reference
- src/index.ts:324-332 (handler)The handler for the "get_item" tool within the CallToolRequest handler. It validates the item_id argument, calls the QiitaClient's getItem method, and returns the result as formatted JSON text content.case "get_item": { if (!args?.item_id) { throw new Error("item_id is required"); } const result = await qiitaClient.getItem(args.item_id as string); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:155-164 (schema)Input schema definition for the "get_item" tool, specifying an object with a required 'item_id' string property.inputSchema: { type: "object", properties: { item_id: { type: "string", description: "Article ID", }, }, required: ["item_id"], },
- src/index.ts:152-165 (registration)Tool registration object for "get_item" in the tools array, used by the ListToolsRequest handler to expose the tool.{ name: "get_item", description: "Get a specific Qiita article by its ID.", inputSchema: { type: "object", properties: { item_id: { type: "string", description: "Article ID", }, }, required: ["item_id"], }, },
- src/index.ts:62-64 (helper)Helper method in QiitaClient class that performs the actual API fetch for a specific item by ID using the private fetch method.async getItem(itemId: string): Promise<any> { return this.fetch(`/items/${itemId}`); }