Skip to main content
Glama

unstock_item

Remove an article from your Qiita stock list to manage your saved content by providing the article ID.

Instructions

指定された記事のストックを解除します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYes記事ID

Implementation Reference

  • The MCP tool handler for 'unstock_item'. It validates input using itemIdSchema and delegates execution to QiitaApiClient.unstockItem(itemId).
    unstock_item: { schema: itemIdSchema, execute: async ({ itemId }, client) => client.unstockItem(itemId), },
  • The input schema and metadata definition for the 'unstock_item' tool used in MCP tool listing.
    { name: 'unstock_item', description: '指定された記事のストックを解除します', inputSchema: { type: 'object', properties: { itemId: { type: 'string', description: '記事ID', }, }, required: ['itemId'], }, },
  • The core implementation of unstocking an item: authenticates, sends DELETE to Qiita API /items/{itemId}/stock, returns success.
    async unstockItem(itemId: string) { this.assertAuthenticated(); await this.client.delete(`/items/${itemId}/stock`); return { success: true }; }
  • src/index.ts:30-65 (registration)
    The tool call request handler registration, which dynamically dispatches to the appropriate handler (including unstock_item) based on name, using toolHandlers map.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const accessToken = process.env.QIITA_ACCESS_TOKEN; const qiita = new QiitaApiClient(accessToken); const handler = toolHandlers[name]; try { if (!handler) { throw new Error(`未知のツール: ${name}`); } const parsedArgs = handler.schema.parse(args ?? {}); const result = await handler.execute(parsedArgs, qiita); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error: any) { const message = error?.message ?? String(error); return { content: [ { type: 'text', text: `エラーが発生しました: ${message}`, }, ], isError: true, }; } });
  • Shared Zod schema for itemId input, used by unstock_item and other item-related tools.
    const itemIdSchema = z.object({ itemId: z.string(), });

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

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